aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tableview
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-25 10:44:41 +1000
commit5cdec4e0c7b0d292c4d099189dd27c19eb314f2d (patch)
treec80c25cb9b5c40fbb39fe4aea88636085987108f /examples/quick/tableview
parent58127aa35945dc76bd71b69b25d141025267f4c8 (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 Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit a86fd709dd4d315cfe4fea77ea0bc730131fe840) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/tableview')
-rw-r--r--examples/quick/tableview/gameoflife/CMakeLists.txt25
-rw-r--r--examples/quick/tableview/pixelator/CMakeLists.txt25
2 files changed, 12 insertions, 38 deletions
diff --git a/examples/quick/tableview/gameoflife/CMakeLists.txt b/examples/quick/tableview/gameoflife/CMakeLists.txt
index a5faa08470..f47c27a7ce 100644
--- a/examples/quick/tableview/gameoflife/CMakeLists.txt
+++ b/examples/quick/tableview/gameoflife/CMakeLists.txt
@@ -35,18 +35,12 @@ target_link_libraries(gameoflife PUBLIC
Qt::Quick
)
-
-# Resources:
-set(qmake_immediate_resource_files
- "gosperglidergun.cells"
- "main.qml"
-)
-
-qt6_add_resources(gameoflife "qmake_immediate"
- PREFIX
- "/"
- FILES
- ${qmake_immediate_resource_files}
+qt_add_qml_module(gameoflife
+ URI GameOfLifeModel
+ VERSION 1.0
+ QML_FILES main.qml
+ RESOURCES gosperglidergun.cells
+ NO_RESOURCE_TARGET_PATH
)
install(TARGETS gameoflife
@@ -54,10 +48,3 @@ install(TARGETS gameoflife
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(gameoflife PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI GameOfLifeModel
-)
-
-qt6_qml_type_registration(gameoflife)
diff --git a/examples/quick/tableview/pixelator/CMakeLists.txt b/examples/quick/tableview/pixelator/CMakeLists.txt
index fcd9784913..4db28964df 100644
--- a/examples/quick/tableview/pixelator/CMakeLists.txt
+++ b/examples/quick/tableview/pixelator/CMakeLists.txt
@@ -35,18 +35,12 @@ target_link_libraries(qml_pixelator PUBLIC
Qt::Quick
)
-
-# Resources:
-set(qmake_immediate_resource_files
- "main.qml"
- "qt.png"
-)
-
-qt6_add_resources(qml_pixelator "qmake_immediate"
- PREFIX
- "/"
- FILES
- ${qmake_immediate_resource_files}
+qt_add_qml_module(qml_pixelator
+ URI ImageModel
+ VERSION 1.0
+ QML_FILES main.qml
+ RESOURCES qt.png
+ NO_RESOURCE_TARGET_PATH
)
install(TARGETS qml_pixelator
@@ -54,10 +48,3 @@ install(TARGETS qml_pixelator
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(qml_pixelator PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI ImageModel
-)
-
-qt6_qml_type_registration(qml_pixelator)