Class: RubyQt6::QtCore::Private::SignalManager
- Inherits:
-
Object
- Object
- RubyQt6::QtCore::Private::SignalManager
- Defined in:
- lib/qt6/qtcore/private/signalmanager.rb
Class Method Summary collapse
- .connect(sender, signal, receiver, metamethod) ⇒ Object
- .disconnect(sender, signal, receiver, metamethod) ⇒ Object
- .emit(sender, signal, *args) ⇒ Object
Class Method Details
.connect(sender, signal, receiver, metamethod) ⇒ Object
7 8 9 10 |
# File 'lib/qt6/qtcore/private/signalmanager.rb', line 7 def self.connect(sender, signal, receiver, ) = QtCore::Private::MetaObject.(receiver, , signal) QtCore::QObject._connect(sender, signal.qsignature, receiver, .qsignature) end |
.disconnect(sender, signal, receiver, metamethod) ⇒ Object
12 13 14 15 |
# File 'lib/qt6/qtcore/private/signalmanager.rb', line 12 def self.disconnect(sender, signal, receiver, ) = QtCore::Private::MetaObject.(receiver, , signal) QtCore::QObject._disconnect(sender, signal.qsignature, receiver, .qsignature) end |
.emit(sender, signal, *args) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/qt6/qtcore/private/signalmanager.rb', line 17 def self.emit(sender, signal, *args) qmo = sender.class. = qmo.method(qmo.index_of_signal(signal.qsignature[1..])) raise "Too many arguments" if .parameter_count < args.count raise "Not enough arguments" if .parameter_count > args.count args = args.map.with_index { |arg, i| QtCore::QVariant.new(arg, .(i)) } QtCore::QObject._emit(sender, , args) end |