aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype_p.h
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-09-18 12:03:09 +0200
committerKai Koehne <kai.koehne@qt.io>2018-10-09 07:50:37 +0000
commitb7f5d34602e72eeda6620ea3e4326c6ff26b52d5 (patch)
tree5525654e04a9cad638eb925802e9b0f54e8e4bf5 /src/qml/qml/qqmlmetatype_p.h
parent9aa954e20e9fd02581d7334bda32deeb09752e66 (diff)
qmlplugindump: Properly handle extension types
Extension classes do augment the primary C++ class with additional properties that should be part of the QML type. Anyhow, they should not be visible in the API. The old logic tried to emulate this by making the extension class the actual C++ type, and 'inheriting' from the normal class by setting it in the prototype. Anyhow, this failed for e.g. Qt3D, where there are numerous types sharing the same extension class. Instead, this patch fixes the issue a) hiding the extension class metainformation itself, and b) printing properties of the extension class as part of the main type. In the QMetaObject collection phase, we now traverse the class hierarchy using QQmlType::baseMetaObject instead of QQmlType::metaObject. In the generation phase, we explicitly resolve the extended type, and dump additional properties and "DefaultProperty" information into the main type description. Note that the ExtendedType sets the DefaultProperty independent of the version. Changing this would require either revisioning the defaultProperty, or (again) splitting up the types, which however brings other problems. Task-number: QTBUG-70294 Change-Id: I324469152398a605fae9e5a35b619845444ac4e8 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype_p.h')
-rw-r--r--src/qml/qml/qqmlmetatype_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 4a5e4ba266..b3ca6acd64 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -201,6 +201,8 @@ public:
QQmlCustomParser *customParser() const;
bool isCreatable() const;
+ typedef QObject *(*ExtensionFunc)(QObject *);
+ ExtensionFunc extensionFunction() const;
bool isExtendedType() const;
QString noCreationReason() const;