| ID | Creation date | 29 December 2008 | |
| Platform | S60 3rd Edition, S60 5th Edition | Tested on devices | Emulator |
| Category | Qt for Symbian | Subcategory |
| Keywords (APIs, classes, methods, functions): Q_OBJECT |
The Q_OBJECT macro at the beginning of the class definition is necessary for all classes that define signals, slots or uses a service provided by the meta-object system.
The QObject class is the base class for the object that uses the meta-object system (like signals and slots). Q_OBJECT enables the meta-object feature and it must be written without ';' at the end of line.
Forgetting Q_OBJECT is a common error among beginners. The class will not compile, and the compiler shows some errors about some methods missing in the table.
#include <QObject>
class Counter: public QObject
{
Q_OBJECT
//some code here
};
No related wiki articles found