aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/quickwidgets/quickwidget
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-23 18:26:06 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-24 16:08:21 +1000
commita86fd709dd4d315cfe4fea77ea0bc730131fe840 (patch)
treed63e9a2240f00f298905b11cddcac49cb0ee25be /examples/quick/quickwidgets/quickwidget
parent9e1d2a0eb15487f8f2acb4d91b281568897fb4e1 (diff)
Update quick examples to new QML CMake API
This is a pre-requisite to being able to make qt6_qml_type_registration() an internal rather than public command. Not all examples have been updated, only those that were using the qt6_qml_type_registration() command. Task-number: QTBUG-95093 Pick-to: 6.2 Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/quick/quickwidgets/quickwidget')
-rw-r--r--examples/quick/quickwidgets/quickwidget/CMakeLists.txt29
1 files changed, 9 insertions, 20 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/CMakeLists.txt b/examples/quick/quickwidgets/quickwidget/CMakeLists.txt
index fabc141f3e..5aeeb70505 100644
--- a/examples/quick/quickwidgets/quickwidget/CMakeLists.txt
+++ b/examples/quick/quickwidgets/quickwidget/CMakeLists.txt
@@ -37,19 +37,15 @@ target_link_libraries(quickwidget PUBLIC
Qt::Widgets
)
-
-# Resources:
-set(quickwidget_resource_files
- "customgl.qml"
- "rotatingsquare.qml"
- "rotatingsquaretab.qml"
-)
-
-qt6_add_resources(quickwidget "quickwidget"
- PREFIX
- "/quickwidget"
- FILES
- ${quickwidget_resource_files}
+qt_add_qml_module(quickwidget
+ URI QuickWidgetExample
+ VERSION 1.0
+ QML_FILES
+ customgl.qml
+ rotatingsquare.qml
+ rotatingsquaretab.qml
+ RESOURCE_PREFIX /quickwidget
+ NO_RESOURCE_TARGET_PATH
)
install(TARGETS quickwidget
@@ -57,10 +53,3 @@ install(TARGETS quickwidget
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(quickwidget PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI QuickWidgetExample
-)
-
-qt6_qml_type_registration(quickwidget)