diff options
author | Ulf Hermann <[email protected]> | 2020-09-16 16:41:27 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2020-09-23 14:54:46 +0200 |
commit | 8e222a70d19d5eef616e1d6306415da64fbab4cb (patch) | |
tree | 535e4cd02c2dbca0289bc6ec39f2699856554737 /src/quick/util/qquickglobal.cpp | |
parent | 90b5d7fa03f9818fa5edc897ee6a109fcc182b9e (diff) |
Allow proper registration of value types
You can now have an extension object on a value type that offers
additional properties. This is how we model the QtQuick value types. It
allows us to retrieve the extension's metaobject without using the
virtual functions in the value type provider.
As before, this mechanism is still rather dangerous and not fit for
public consumption. It relies on the extension object having exactly the
same layout as the original value type, and it hides any properties the
original value type might expose.
Furthermore we enforce now that gadgets should have lowercase names.
The ones that didn't before are split up into an anonymous value type
and a namespace that contains all the addressable bits.
Task-number: QTBUG-82443
Change-Id: Ic93d6764538d6ccc0774b3c5648eee08ba0939c0
Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/quick/util/qquickglobal.cpp')
-rw-r--r-- | src/quick/util/qquickglobal.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp index bf636407ed..9fe4c6c119 100644 --- a/src/quick/util/qquickglobal.cpp +++ b/src/quick/util/qquickglobal.cpp @@ -581,32 +581,6 @@ public: return QMatrix4x4(matVals); } - const QMetaObject *getMetaObjectForMetaType(int type) override - { - switch (type) { - case QMetaType::QColor: - return &QQuickColorValueType::staticMetaObject; - case QMetaType::QColorSpace: - return &QQuickColorSpaceValueType::staticMetaObject; - case QMetaType::QFont: - return &QQuickFontValueType::staticMetaObject; - case QMetaType::QVector2D: - return &QQuickVector2DValueType::staticMetaObject; - case QMetaType::QVector3D: - return &QQuickVector3DValueType::staticMetaObject; - case QMetaType::QVector4D: - return &QQuickVector4DValueType::staticMetaObject; - case QMetaType::QQuaternion: - return &QQuickQuaternionValueType::staticMetaObject; - case QMetaType::QMatrix4x4: - return &QQuickMatrix4x4ValueType::staticMetaObject; - default: - break; - } - - return nullptr; - } - bool create(int type, int argc, const void *argv[], QVariant *v) override { switch (type) { |