PDA

View Full Version : A bout Q_Object?



rezas1000
9th August 2014, 15:34
Hi Friends

Exactly what is Q_Object?
thanks.

anda_skoa
9th August 2014, 16:00
It is a C++ preprocessor macro that has two complimentary features:

1) the C++ preprocessor expands it into code, mainly function declarations, see qgobals.h
2) it serves as a marker for the MOC code generation tool, which generates the implementation of these functions (and some a meta data object for the class)

It is needed for QObject derived classes that declare their own signals and slots or their own Qt properties (using the Q_PROPERTY macro).

Cheers,
_