PDA

View Full Version : including QObject



ravas
30th October 2015, 17:42
I've noticed that #include <QObject> doesn't seem to be necessary in the .h when you subclass QObject.
Is it included in all files associated with a .pro file, or is the Q_OBJECT macro responsible?

west
30th October 2015, 23:38
Maybe some other file includes it and you are including it not directly?
What files are you including to .h file of your QObject subclass?

ravas
31st October 2015, 01:45
I see one included file has <Qt>, <QtGlobal> and <QtPrintSupport/QPrinter>.
But I didn't see any mention of QObject in their documentation.

ChrisW67
31st October 2015, 03:09
You get QObject indirectly through at least the QPrinter include.

There is no include file <Qt> I can see.