Class: Qt::MetaInfo
Instance Attribute Summary collapse
-
#changed ⇒ Object
Returns the value of attribute changed.
-
#classinfos ⇒ Object
Returns the value of attribute classinfos.
-
#dbus ⇒ Object
Returns the value of attribute dbus.
-
#metaobject ⇒ Object
Returns the value of attribute metaobject.
-
#mocargs ⇒ Object
Returns the value of attribute mocargs.
-
#signals ⇒ Object
Returns the value of attribute signals.
-
#slots ⇒ Object
Returns the value of attribute slots.
Instance Method Summary collapse
- #add_classinfo(key, value) ⇒ Object
- #add_signals(signal_list) ⇒ Object
- #add_slots(slot_list) ⇒ Object
-
#get_signals ⇒ Object
Return a list of signals, including inherited ones.
-
#initialize(klass) ⇒ MetaInfo
constructor
A new instance of MetaInfo.
Constructor Details
#initialize(klass) ⇒ MetaInfo
Returns a new instance of MetaInfo.
2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 |
# File 'lib/qt/qtruby4.rb', line 2550 def initialize(klass) Meta[klass.name] = self @klass = klass @metaobject = nil @signals = [] @slots = [] @classinfos = [] @dbus = false @changed = false Internal.addMetaObjectMethods(klass) end |
Instance Attribute Details
#changed ⇒ Object
Returns the value of attribute changed.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def changed @changed end |
#classinfos ⇒ Object
Returns the value of attribute classinfos.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def classinfos @classinfos end |
#dbus ⇒ Object
Returns the value of attribute dbus.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def dbus @dbus end |
#metaobject ⇒ Object
Returns the value of attribute metaobject.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def @metaobject end |
#mocargs ⇒ Object
Returns the value of attribute mocargs.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def mocargs @mocargs end |
#signals ⇒ Object
Returns the value of attribute signals.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def signals @signals end |
#slots ⇒ Object
Returns the value of attribute slots.
2548 2549 2550 |
# File 'lib/qt/qtruby4.rb', line 2548 def slots @slots end |
Instance Method Details
#add_classinfo(key, value) ⇒ Object
2607 2608 2609 2610 2611 2612 |
# File 'lib/qt/qtruby4.rb', line 2607 def add_classinfo(key, value) @classinfos.push [key, value] if key == 'D-Bus Interface' @dbus = true end end |
#add_signals(signal_list) ⇒ Object
2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 |
# File 'lib/qt/qtruby4.rb', line 2562 def add_signals(signal_list) 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) signal_names << $3 else qWarning( "#{@klass.name}: Invalid signal format: '#{signal}'" ) end end Internal.addSignalMethods(@klass, signal_names) end |
#add_slots(slot_list) ⇒ Object
2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 |
# File 'lib/qt/qtruby4.rb', line 2593 def add_slots(slot_list) 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) else qWarning( "#{@klass.name}: Invalid slot format: '#{slot}'" ) end end end |
#get_signals ⇒ Object
Return a list of signals, including inherited ones
2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 |
# File 'lib/qt/qtruby4.rb', line 2580 def get_signals all_signals = [] current = @klass while current != Qt::Base = Meta[current.name] if !.nil? all_signals.concat .signals end current = current.superclass end return all_signals end |