aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/qmlfunctions.qdoc
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-28 16:48:53 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-11-02 14:00:17 +0100
commit6f968781c4c8a278a7743b0904fb2bdf4c6ddf1a (patch)
tree0d5944f74c10bf3223cb374234c7f6d78706714f /src/qml/doc/src/qmlfunctions.qdoc
parent2b99430671e37427a990973df37e62ad8cdebe8b (diff)
QML: Allow namespaces as extensions to types
This way we can access the enums of namespaces as properties of the primary type. This is achieved by: 1. Making enums of extended types available in the base type 2. Allowing the extension to be specified as plain metaObject rather than as type name. 3. Refraining from creating the extension if the create function does not exist. The goal of this is to declare the Qt namespace in a civilized way, but will also help with cleaning up the QtQuick value types and their enums. Change-Id: I13399741d30ce38d1bff753cfa1b11e72ccfbf6a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/doc/src/qmlfunctions.qdoc')
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index c0c481b861..caca58f34a 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -230,10 +230,24 @@
\relates QQmlEngine
Declares that the enclosing type uses \a EXTENDED_TYPE as an extension to
- provide further properties and methods in QML. This takes effect if the type
+ provide further properties, methods, and enumerations in QML. This takes
+ effect if the type is exposed to QML using a \l QML_ELEMENT or
+ \l QML_NAMED_ELEMENT() macro.
+
+ \sa QML_ELEMENT, QML_NAMED_ELEMENT(), QML_EXTENDED_NAMEPSACE(),
+ {Registering Extension Objects}
+*/
+
+/*!
+ \macro QML_EXTENDED_NAMESPACE(EXTENDED_NAMESPACE)
+ \relates QQmlEngine
+
+ Declares that the enclosing type uses \a EXTENDED_NAMESPACE as an extension to
+ provide further enumerations in QML. This takes effect if the type
is exposed to QML using a \l QML_ELEMENT or \l QML_NAMED_ELEMENT() macro.
- \sa QML_ELEMENT, QML_NAMED_ELEMENT(), {Registering Extension Objects}
+ \sa QML_ELEMENT, QML_NAMED_ELEMENT(), QML_EXTENDED(),
+ {Registering Extension Objects}
*/
/*!
@@ -243,9 +257,9 @@
Declares that any \l QML_ELEMENT, \l QML_NAMED_ELEMENT(), \l QML_ANONYMOUS,
\l QML_INTERFACE, \l QML_UNCREATABLE(), \l QML_SINGLETON,
\l QML_ADDED_IN_MINOR_VERSION(), \l QML_REMOVED_IN_MINOR_VERSION(),
- \l QML_ATTACHED(), or \l QML_EXTENDED() macros in the enclosing C++ type do
- not apply to the enclosing type but instead to \a FOREIGN_TYPE. The enclosing
- type still needs to be registered with the
+ \l QML_ATTACHED(), \l QML_EXTENDED(), or \l QML_EXTENDED_NAMESPACE() macros
+ in the enclosing C++ type do not apply to the enclosing type but instead to
+ \a FOREIGN_TYPE. The enclosing type still needs to be registered with the
\l {The Meta-Object System}{meta object system} using a \l Q_GADGET or
\l Q_OBJECT macro.