diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-10-18 10:03:18 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-10-21 12:47:54 +0200 |
commit | 16cbcc606d431456ef5ab6783705a37d27776207 (patch) | |
tree | 6e4727307e75beadc3c9a532c29ffcd93f9a7a00 /src/qml/qml/qqmlmetatype_p.h | |
parent | c23f85e159245f4f01f095bbb50dd01df4df2b62 (diff) |
Add support for primitive self-references in composite types
This has been long missing and will also help with the implementation of
inline components and the referenced bugs.
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Task-number: QTBUG-41087
Task-number: QTBUG-35910
Change-Id: Ia42a8f9808ece543f8ce2314b3352507fab22c62
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype_p.h')
-rw-r--r-- | src/qml/qml/qqmlmetatype_p.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h index 13ba4d809b..146a5ab136 100644 --- a/src/qml/qml/qqmlmetatype_p.h +++ b/src/qml/qml/qqmlmetatype_p.h @@ -80,8 +80,17 @@ public: static void unregisterType(int type); - static void registerInternalCompositeType(QV4::ExecutableCompilationUnit *compilationUnit); - static void unregisterInternalCompositeType(QV4::ExecutableCompilationUnit *compilationUnit); + struct CompositeMetaTypeIds + { + int id = -1; + int listId = -1; + CompositeMetaTypeIds() = default; + CompositeMetaTypeIds(int id, int listId) : id(id), listId(listId) {} + bool isValid() const { return id != -1 && listId != -1; } + }; + + static CompositeMetaTypeIds registerInternalCompositeType(const QByteArray &className); + static void unregisterInternalCompositeType(const QQmlMetaType::CompositeMetaTypeIds &typeIds); static void registerModule(const char *uri, int versionMajor, int versionMinor); static bool protectModule(const QString &uri, int majVersion); |