Document Q_GADGET

[ChangeLog][QtCore] Classes with the Q_GADGET function can now have properties and
invokable methods. QMetaMethod and QMetaProperty have new overloads that can be used with
a pointer to a gadget. The QMetaType system also gained knowledge of types with the
Q_GADGET macro

Change-Id: I017475f3809181c64fdd66f899e461ad27f5ae47
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
This commit is contained in:
Olivier Goffart 2014-08-10 19:45:41 +02:00 committed by Olivier Goffart (Woboq GmbH)
parent cc67960f8c
commit 2f38c3fa04

View File

@ -4251,15 +4251,28 @@ QDebug qt_QMetaEnum_debugOperator(QDebug &dbg, int value, const QMetaObject *met
\note This macro requires the class to be a subclass of QObject. Use
Q_GADGET instead of Q_OBJECT to enable the meta object system's support
for enums in a class that is not a QObject subclass. Q_GADGET makes a
class member, \c{staticMetaObject}, available.
\c{staticMetaObject} is of type QMetaObject and provides access to the
enums declared with Q_ENUMS.
Q_GADGET is provided only for C++.
for enums in a class that is not a QObject subclass.
\sa {Meta-Object System}, {Signals and Slots}, {Qt's Property System}
*/
/*!
\macro Q_GADGET
\relates QObject
The Q_GADGET macro is a lighter version of the Q_OBJECT macro for classes
that do not inherit from QObject but still want to use some of the
reflection capabilities offered by QMetaObject. Just like the Q_OBJECT
macro, it must appear in the private section of a class definition.
Q_GADGETs can have Q_ENUM, Q_PROPERTY and Q_INVOKABLE, but they cannot have
signals or slots
Q_GADGET makes a class member, \c{staticMetaObject}, available.
\c{staticMetaObject} is of type QMetaObject and provides access to the
enums declared with Q_ENUMS.
*/
/*!
\macro Q_SIGNALS
\relates QObject