Is it possible to see definition of Q_SIGNALS, Q_SLOT, SLOT(), SIGNAL() macros in Qt framework?
P.S. Google gave me nothing in this question.
In Qt, we have an alternative to the callback technique: We use signals and slots. A signal is emitted when a particular event occurs. Qt's widgets have many predefined signals, but we can always subclass widgets to add our own signals to them. A slot is a function that is called in response to a particular signal.
This ensures that truly independent components can be created with Qt. You can connect as many signals as you want to a single slot, and a signal can be connected to as many slots as you need. It is even possible to connect a signal directly to another signal.
Form qobjectdefs.h
, for a non-debug compilation:
#define Q_SLOTS
#define Q_SIGNALS protected
#define SLOT(a) "1"#a
#define SIGNAL(a) "2"#a
The Q_SLOTS
and Q_SIGNALS
declarations are only treated specially by the moc
run, in the final compilation they reduce to simple method declarations. SIGNAL()
and SLOT()
create names from the provided signatures.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With