diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-12-08 18:28:40 +0100 |
|---|---|---|
| committer | Amir Masoud Abdol <amir.abdol@qt.io> | 2023-02-01 23:39:19 +0100 |
| commit | ec452fc6e87e82d135d7ef782d5c811583d5c433 (patch) | |
| tree | d23a91de87691375298ee23435fc4bd1f21a3475 /examples/quickcontrols/chattutorial/chapter2 | |
| parent | a6d9312c99d6f80cbea7538276d2890d0cc4c760 (diff) | |
qt_add_qml_module: Make usage of AUTO_RESOURCE_PREFIX a policy
Writing AUTO_RESOURCE_PREFIX in every qt_add_qml_module call seems
rather pointless.
In addition:
- Add documentation for QTP0001.
- Adjust some of the examples to use QTP0001 policy.
- Improved the error message.
Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I6e19a491acba97493893bf1953fca3462296c1ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'examples/quickcontrols/chattutorial/chapter2')
3 files changed, 3 insertions, 2 deletions
diff --git a/examples/quickcontrols/chattutorial/chapter2/CMakeLists.txt b/examples/quickcontrols/chattutorial/chapter2/CMakeLists.txt index 0669626a06..561861afc0 100644 --- a/examples/quickcontrols/chattutorial/chapter2/CMakeLists.txt +++ b/examples/quickcontrols/chattutorial/chapter2/CMakeLists.txt @@ -25,6 +25,7 @@ target_link_libraries(chattutorial-chapter2 PRIVATE Qt::Quick ) +qt_policy(SET QTP0001 NEW) qt_add_qml_module(chattutorial-chapter2 URI chapter2 QML_FILES diff --git a/examples/quickcontrols/chattutorial/chapter2/chapter2.pro b/examples/quickcontrols/chattutorial/chapter2/chapter2.pro index 00cf68b57c..8679db986a 100644 --- a/examples/quickcontrols/chattutorial/chapter2/chapter2.pro +++ b/examples/quickcontrols/chattutorial/chapter2/chapter2.pro @@ -19,7 +19,7 @@ resources.files = \ images/Hans_Gude@3x.png \ images/Hans_Gude@4x.png \ main.qml -resources.prefix = chapter2/ +resources.prefix = qt/qml/chapter2/ RESOURCES += resources \ qtquickcontrols2.conf diff --git a/examples/quickcontrols/chattutorial/chapter2/main.cpp b/examples/quickcontrols/chattutorial/chapter2/main.cpp index eeb87becca..07f034a827 100644 --- a/examples/quickcontrols/chattutorial/chapter2/main.cpp +++ b/examples/quickcontrols/chattutorial/chapter2/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/chapter2/main.qml"))); + engine.load(QUrl(QStringLiteral("qrc:/qt/qml/chapter2/main.qml"))); return app.exec(); } |
