aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/tutorials/extending-qml/chapter5-listproperties
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-23 16:29:18 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-24 16:08:21 +1000
commit9e1d2a0eb15487f8f2acb4d91b281568897fb4e1 (patch)
treee055ea022161b4dbbecbb94c2c1fa7c4a83a5ee8 /examples/qml/tutorials/extending-qml/chapter5-listproperties
parent05bee5bb50378b76b6441895c533f50d99db445e (diff)
Update qml examples for improved target path handling
Some examples were still using the old "add as ordinary resources" approach for QML modules, others needed adjustment to the subdirectory structure to better reflect the URI structure of the QML modules involved. Task-number: QTBUG-95144 Pick-to: 6.2 Change-Id: Ie3399410cf6df491eb1e7b4a589ca26c577d82a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/qml/tutorials/extending-qml/chapter5-listproperties')
-rw-r--r--examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt23
1 files changed, 5 insertions, 18 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt
index 4fa74097e7..1891bc34d5 100644
--- a/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt
+++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt
@@ -36,17 +36,11 @@ target_link_libraries(chapter5-listproperties PUBLIC
Qt::Quick
)
-
-# Resources:
-set(chapter5-listproperties_resource_files
- "app.qml"
-)
-
-qt6_add_resources(chapter5-listproperties "chapter5-listproperties"
- PREFIX
- "/"
- FILES
- ${chapter5-listproperties_resource_files}
+qt_add_qml_module(chapter5-listproperties
+ URI Charts
+ VERSION 1.0
+ QML_FILES app.qml
+ NO_RESOURCE_TARGET_PATH
)
install(TARGETS chapter5-listproperties
@@ -54,10 +48,3 @@ install(TARGETS chapter5-listproperties
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(chapter5-listproperties PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI Charts
-)
-
-qt6_qml_type_registration(chapter5-listproperties)