Tutorial by Examples

Q_OBJECT macro appears in private section of a class. Q_OBJECT requires the class to be subclass of QObject. This macro is necessary for the class to declare its signals/slots and to use Qt meta-object system. If Meta Object Compiler (MOC) finds class with Q_OBJECT, it processes it and generates C+...
T qobject_cast(QObject *object) A functionality which is added by deriving from QObject and using the Q_OBJECT macro is the ability to use the qobject_cast. Example: class myObject : public QObject { Q_OBJECT //... }; QObject* obj = new myObject(); To check whether obj is a my...
QObjects come with their own alternative lifetime concept compared to native C++'s raw,unique or shared pointers. QObjects have the possibility to build an objecttree by declaring parent/child relationships. The simplest way to declare this relationship is by passing the parent object in the const...

Page 1 of 1