What is the Q_OBJECT macro, please? I don't mean what's the code
corresponding to it, but what does it do?
Mariane
What is the Q_OBJECT macro, please? I don't mean what's the code
corresponding to it, but what does it do?
Mariane
It defines some class members needed for reflection and other special Qt features provided by classes derived from QObject.
You have to put the Q_OBJECT macro in every class where you want to use signals and slots.
You can read more about it in the documentation : signals and slots.
Cheers
This is not exactly true. You can omit the macro if you derive from a class which had it defined and you don't introduce any new signals or slots. If any of these two conditions is not met, you have to use that macro.Originally Posted by Everall
@Wysota :Yes, you explained it in a better analytical way.
What do you think of the following:
You have to put the Q_OBJECT macro in every class where you want to use your own signals and slots.
Cheers
Thank you
Mariane
Bookmarks