[Development] Usage of Q_OBJECT macro in QObject subclasses that don't use signals, slots, or properties

André Somers andre at familiesomers.nl
Mon Mar 7 20:58:42 CET 2016

Op 07/03/2016 om 20:55 schreef Curtis Mitch:
> Recently I noticed this sentence in QObject's documentation [1]:
> We strongly recommend the use of this macro in all subclasses of QObject regardless of whether or not they actually use signals, slots and properties, since failure to do so may lead certain functions to exhibit strange behavior.
> Why is this the case? What strange behaviour could result from not doing so?
> [1] http://doc.qt.io/qt-5/qobject.html#Q_OBJECT
Functions like QObject::inherits come to mind.


More information about the Development mailing list