aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-08-22 16:36:42 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-01-10 18:01:27 +0100
commit1cd494fbfb3eaf21717697c3c7df39b214b48ee3 (patch)
tree6ec56567a6f3355b1814ac18169d354239a729fc /src/qmlmodels
parent8550dff55c62b4f2b588513014b5cad8fe2c5f5b (diff)
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 <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlmodels')
-rw-r--r--src/qmlmodels/qmlmodels.pro6
-rw-r--r--src/qmlmodels/qqmlmodelsmodule.cpp18
-rw-r--r--src/qmlmodels/qqmlmodelsmodule_p.h3
3 files changed, 6 insertions, 21 deletions
diff --git a/src/qmlmodels/qmlmodels.pro b/src/qmlmodels/qmlmodels.pro
index 78bf579903..4ac093556d 100644
--- a/src/qmlmodels/qmlmodels.pro
+++ b/src/qmlmodels/qmlmodels.pro
@@ -64,4 +64,10 @@ qtConfig(qml-delegate-model) {
$$PWD/qquickpackage_p.h
}
+QMLTYPES_FILENAME = plugins.qmltypes
+QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml/Models.2
+QML_IMPORT_NAME = QtQml.Models
+IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+CONFIG += qmltypes install_qmltypes install_metatypes
+
load(qt_module)
diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp
index dfd5632314..155ded6c65 100644
--- a/src/qmlmodels/qqmlmodelsmodule.cpp
+++ b/src/qmlmodels/qqmlmodelsmodule.cpp
@@ -96,22 +96,4 @@ void QQmlModelsModule::registerQuickTypes()
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-void QQmlModelsModule::defineModule()
-{
- const char uri[] = "QtQml.Models";
-
-#if QT_CONFIG(qml_list_model)
- qmlRegisterTypesAndRevisions<QQmlListElement, QQmlListModel, QQmlListModelWorkerAgent>(uri, 2);
-#endif
-#if QT_CONFIG(qml_delegate_model)
- qmlRegisterTypesAndRevisions<QQmlDelegateModel, QQmlDelegateModelGroup, QQuickPackage, QQmlAbstractDelegateComponent>(uri, 2);
-#endif
-#if QT_CONFIG(qml_object_model)
- qmlRegisterTypesAndRevisions<QQmlObjectModel, QQmlInstantiator, QQmlInstanceModel>(uri, 2);
-#endif
-#if QT_CONFIG(itemmodel)
- qmlRegisterTypesAndRevisions<QItemSelectionModelForeign>(uri, 2);
-#endif
-}
-
QT_END_NAMESPACE
diff --git a/src/qmlmodels/qqmlmodelsmodule_p.h b/src/qmlmodels/qqmlmodelsmodule_p.h
index 85c87b35a2..feed0f88fe 100644
--- a/src/qmlmodels/qqmlmodelsmodule_p.h
+++ b/src/qmlmodels/qqmlmodelsmodule_p.h
@@ -68,9 +68,6 @@ public:
static void registerQmlTypes();
static void registerQuickTypes();
#endif
-
- static void defineModule();
- static void defineLabsModule();
};
#if QT_CONFIG(itemmodel)