aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-12-23 11:17:08 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2019-12-23 14:42:18 +0100
commit46d1b5b5a9d8fd1fd6629afd67eec7b32fc840fc (patch)
treedaf94b985335639261d4ec9332da9079e3744a9c /src/qml/doc/src
parentde2f7ef280771df03398a375230cb42e23ae25d7 (diff)
doc: Clarify Q_GADGET limitations in Qt 5
Fixes: QTBUG-79640 Change-Id: I7c4377312a337ec5f65389dc4998f1df91e5f67c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r--src/qml/doc/src/cppintegration/data.qdoc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc
index 6bf7dbfb8f..7c2693508c 100644
--- a/src/qml/doc/src/cppintegration/data.qdoc
+++ b/src/qml/doc/src/cppintegration/data.qdoc
@@ -386,6 +386,14 @@ properties:
Q_DECLARE_METATYPE(Actor)
\endcode
+The usual pattern is to use a gadget class as the type of a property, or to
+emit a gadget as a signal argument. In such cases, the gadget instance is
+passed by value between C++ and QML (because it's a value type). If QML code
+changes a property of a gadget property, the entire gadget is re-created and
+passed back to the C++ property setter. In Qt 5, gadget types cannot be
+instantiated by direct declaration in QML. In contrast, a QObject instance can
+be declared; and QObject instances are always passed by pointer from C++ to QML.
+
\section1 Enumeration Types
To use a custom enumeration as a data type, its class must be registered and