diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-01-07 20:19:20 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-01-25 23:55:27 +0100 |
commit | 5a908de8b7e772e78adb30cc3205c7cf5bd622f5 (patch) | |
tree | 0a803fb250a3b89133935ba1e75d2e0eac2f7c23 /src/qml/qml/qqmlpropertydata_p.h | |
parent | 17dcba699566bfe052bf2c320e07c2c7cc53094b (diff) |
Allow custom named value types in QML
You can now add your own, lower-case named, value types to your own
module, and use them in QML. Previously the names had been ignored, but
now you can actually declare properties using the value types.
The QtQuick value types are now handled exactly this way, and their
special casing at compile time is removed.
[ChangeLog][QML][Important Behavior Changes] You can now add your own
value types to QML modules. This works exactly like the registration of
object types, just with Q_GADGET instead of QObject/Q_OBJECT. In turn,
the QtQuick value types are only available from QtQuick now. Previously
you could declare unusable properties of QtQuick value types when only
importing QtQml. This is not possible anymore.
Task-number: QTBUG-82443
Change-Id: I5b2e867141244531cb13d789678fb7e06a6e41e7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmlpropertydata_p.h')
-rw-r--r-- | src/qml/qml/qqmlpropertydata_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlpropertydata_p.h b/src/qml/qml/qqmlpropertydata_p.h index 24e2204b71..5a5ccf7303 100644 --- a/src/qml/qml/qqmlpropertydata_p.h +++ b/src/qml/qml/qqmlpropertydata_p.h @@ -82,7 +82,8 @@ public: QJSValueType = 6, // Property type is a QScriptValue // Gap, used to be V4HandleType VarPropertyType = 8, // Property type is a "var" property of VMEMO - QVariantType = 9 // Property is a QVariant + QVariantType = 9, // Property is a QVariant + ValueType = 10 // Property type is a custom value type }; // The _otherBits (which "pad" the Flags struct to align it nicely) are used |