summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2014-08-10 19:45:41 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2015-02-13 20:42:00 +0000
commit2f38c3fa0449d55230b26c5e993fcb746ef2883e (patch)
tree58991d42aa639f1d4d8e220d28244f8d7036666d /src/corelib/kernel/qobject.cpp
parentcc67960f8c81754bf393c01b46be86fe993d353a (diff)
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>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
-rw-r--r--src/corelib/kernel/qobject.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index bd06e8d87b..98e3f6b5bd 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4251,16 +4251,29 @@ 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