From 6aad465f080e4b0c5f7d1b0944bdd864e19d5783 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 31 May 2022 10:38:07 +0200 Subject: Introduce a sane resource path to qt_add_qml_module Since "/qt" is reserved, we can use "/qt/qml" as the default path for user QML modules. [ChangeLog][QtQml] The AUTO_RESOURCE_PREFIX option was added to qt_add_qml_module(). It places your QML modules in the otherwise reserved resource directory /qt/qml. This directory is also added to the default QML import path. By using it you don't have to specify custom import paths anymore. Specifying neither AUTO_RESOURCE_PREFIX nor an explicit RESOURCE_PREFIX will generate a warning now because such QML modules are likely invisible in the resource file system. Fixes: QTBUG-95145 Fixes: QTBUG-103452 Change-Id: Ie27dec5cbf34ea06258d55c659d202cdd61e54b2 Reviewed-by: Andrei Golubev --- tests/auto/qml/qmlbasicapp/BasicExtension/CMakeLists.txt | 1 + tests/auto/qml/qmlbasicapp/CMakeLists.txt | 1 + tests/auto/qml/qmlbasicapp/TimeExample/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+) (limited to 'tests/auto/qml/qmlbasicapp') diff --git a/tests/auto/qml/qmlbasicapp/BasicExtension/CMakeLists.txt b/tests/auto/qml/qmlbasicapp/BasicExtension/CMakeLists.txt index a08c71a294..1f3dd87dba 100644 --- a/tests/auto/qml/qmlbasicapp/BasicExtension/CMakeLists.txt +++ b/tests/auto/qml/qmlbasicapp/BasicExtension/CMakeLists.txt @@ -9,6 +9,7 @@ qt6_add_qml_module(additional_qml_module CLASS_NAME "BasicExtension" VERSION 1.0 URI "BasicExtension" + RESOURCE_PREFIX "/" QML_FILES Extension.qml More.ui.qml diff --git a/tests/auto/qml/qmlbasicapp/CMakeLists.txt b/tests/auto/qml/qmlbasicapp/CMakeLists.txt index 269cc35980..a8e9a2c0c6 100644 --- a/tests/auto/qml/qmlbasicapp/CMakeLists.txt +++ b/tests/auto/qml/qmlbasicapp/CMakeLists.txt @@ -9,6 +9,7 @@ qt_internal_add_test(tst_qmlbasicapp qt6_add_qml_module(tst_qmlbasicapp VERSION 1.0 URI "BasicApp" + RESOURCE_PREFIX "/" QML_FILES main.qml ) diff --git a/tests/auto/qml/qmlbasicapp/TimeExample/CMakeLists.txt b/tests/auto/qml/qmlbasicapp/TimeExample/CMakeLists.txt index 91bc6dc89e..6114bec093 100644 --- a/tests/auto/qml/qmlbasicapp/TimeExample/CMakeLists.txt +++ b/tests/auto/qml/qmlbasicapp/TimeExample/CMakeLists.txt @@ -3,6 +3,7 @@ qt_autogen_tools_initial_setup(qmlqtimeexample) qt6_add_qml_module(qmlqtimeexample VERSION 1.0 URI "TimeExample" + RESOURCE_PREFIX "/" SOURCES timemodel.cpp timemodel.h QML_FILES -- cgit v1.2.3