From a2b31f073530f61203fe0e9799ad158c4fe6b9f9 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 11 Feb 2020 19:15:59 +0100 Subject: Add a static variant of qmlRegisterInterface() qmlRegisterInterface() should not be called procedurally, for the same reason that qmlRegisterType() should not be called procedurally. Also, add URI and major version parameters to qmlRegisterInterface(), and deprecate the typeName parameter. We want to identify which import an interface belongs to. Task-number: QTBUG-68796 Change-Id: Iba3d66e5ce6219b30aadba34396f12fca92f35a7 Reviewed-by: Fabian Kosmale --- src/qml/qml/qqmlprivate.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/qml/qml/qqmlprivate.h') diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h index 9504fc37dc..9d260f5e94 100644 --- a/src/qml/qml/qqmlprivate.h +++ b/src/qml/qml/qqmlprivate.h @@ -406,6 +406,9 @@ namespace QQmlPrivate int listId; const char *iid; + + const char *uri; + int versionMajor; }; struct RegisterAutoParent { @@ -579,6 +582,18 @@ namespace QQmlPrivate static constexpr bool Value = bool(T::QmlIsSingleton::yes); }; + template> + struct QmlInterface + { + static constexpr bool Value = false; + }; + + template + struct QmlInterface> + { + static constexpr bool Value = bool(T::QmlIsInterface::yes); + }; + template void qmlRegisterSingletonAndRevisions(const char *uri, int versionMajor, const QMetaObject *classInfoMetaObject) -- cgit v1.2.3