Actually, you have to use Q_OBJECT
macro, for any classes that you derive from QOject
.
Besides Signals and slots, Q_OBJECT
macro enables to retrieve the Meta Object information that is associated with the object..
Check out the docs...
From the docs itself,
we strongly recommend that all subclasses of QObject use the Q_OBJECT macro regardless of whether or not they actually use signals, slots, and properties.
You can omit it for time sake, but in the long run you may have to use some of the Meta object features.. Say for e.g you may have to use
QString QObject::tr ( const char * sourceText, const char * disambiguation = 0, int n = -1 ) [static]
In such cases, you have to declare the Q_Object
macro. So, it is better now to use the Q_OBJECT
macro instead of thinking that someone will do it whenever they need it..
or else, if you don't need the Q_OBJECT
macro, have normal C++ classes that doesn't get derived from QObject
... So that it doesn't use any Meta object functionality.
Hope it helps...