class Qt::MetaInfo

Attributes

changed[RW]
classinfos[RW]
dbus[RW]
metaobject[RW]
mocargs[RW]
signals[RW]
slots[RW]

Public Class Methods

new(klass) click to toggle source
# File lib/Qt/qtruby4.rb, line 3070
def initialize(klass)
  Meta[klass.name] = self
  @klass = klass
  @metaobject = nil
  @signals = []
  @slots = []
  @classinfos = []
  @dbus = false
  @changed = false
  Internal.addMetaObjectMethods(klass)
end

Public Instance Methods

add_classinfo(key, value) click to toggle source
# File lib/Qt/qtruby4.rb, line 3135
def add_classinfo(key, value)
  @classinfos.push [key, value]
  if key == 'D-Bus Interface'
    @dbus = true
  end
end
add_signals(signal_list, access) click to toggle source
# File lib/Qt/qtruby4.rb, line 3082
def add_signals(signal_list, access)
  signal_names = []
  signal_list.each do |signal|
    if signal.kind_of? Symbol
      signal = signal.to_s + "()"
    end
    signal = Qt::MetaObject.normalizedSignature(signal).to_s
    if signal =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
      @signals.push QObjectMember.new(  $3,
                                          $3 + "(" + $4 + ")",
                                          $4,
                                          ($2 == 'void' || $2.nil?) ? "" : $2,
                                          access )
      signal_names << $3
    else
      qWarning( "#{@klass.name}: Invalid signal format: '#{signal}'" )
    end
  end
  Internal.addSignalMethods(@klass, signal_names)
end
add_slots(slot_list, access) click to toggle source
# File lib/Qt/qtruby4.rb, line 3117
def add_slots(slot_list, access)
  slot_list.each do |slot|
    if slot.kind_of? Symbol
      slot = slot.to_s + "()"
    end
    slot = Qt::MetaObject.normalizedSignature(slot).to_s
    if slot =~ /^(([\w,<>:]*)\s+)?([^\s]*)\((.*)\)/
      @slots.push QObjectMember.new(  $3,
                                      $3 + "(" + $4 + ")",
                                      $4,
                                      ($2 == 'void' || $2.nil?) ? "" : $2,
                                      access )
    else
      qWarning( "#{@klass.name}: Invalid slot format: '#{slot}'" )
    end
  end
end
get_signals() click to toggle source

Return a list of signals, including inherited ones

# File lib/Qt/qtruby4.rb, line 3104
def get_signals
  all_signals = []
  current = @klass
  while current != Qt::Base
    meta = Meta[current.name]
    if !meta.nil?
      all_signals.concat meta.signals
    end
    current = current.superclass
  end
  return all_signals
end