From 1cd494fbfb3eaf21717697c3c7df39b214b48ee3 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 22 Aug 2019 16:36:42 +0200 Subject: Generate registrations for all imports Now that we can generate all QML type information at build time, we should also use it. Move the types for QtTest into the testlib import plugin. They don't need to be exported from QtQuickTest. Trigger the resource initialization of the shapes library from the plugin so that we retain a dependency and the linker doesn't optimize the module initialization away. Change-Id: Icc8cb338aa03ef1e3085e29356a5db7b73ba0a01 Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale --- src/imports/models/plugin.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/imports/models/plugin.cpp') diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp index 319321013e..d79b31bba5 100644 --- a/src/imports/models/plugin.cpp +++ b/src/imports/models/plugin.cpp @@ -81,20 +81,12 @@ QT_BEGIN_NAMESPACE //![class decl] -class QtQmlModelsPlugin : public QQmlExtensionPlugin +class QtQmlModelsPlugin : public QQmlEngineExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) public: - QtQmlModelsPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQml.Models")); - QQmlModelsModule::defineModule(); - - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.11 onward - qmlRegisterModule(uri, 2, QT_VERSION_MINOR); - } + QtQmlModelsPlugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) { } }; //![class decl] -- cgit v1.2.3