summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-18 18:16:17 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-23 17:26:32 +1000
commit03b026e2c46ac8badd7391897b67a54358479bfa (patch)
tree0384c8c87457a92bbe1a90d8fffa5b2035b64d50 /examples
parent295df0380fffa7ea43c36c26e51bc7ff4d158710 (diff)
downloadqtlocation-03b026e2c46ac8badd7391897b67a54358479bfa.tar.gz
Use the new QML CMake API for examples, tests and docs
The qt6_qml_type_registration() command will become internal. Update the examples, tests and docs to no longer call this command and use the new QML CMake API available from Qt 6.2 instead. Task-number: QTBUG-95093 Pick-to: 6.2 Change-Id: Ibd62ccb4e2723a64d8a2c4418982037419d19855 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/positioning/satelliteinfo/CMakeLists.txt22
-rw-r--r--examples/positioning/satelliteinfo/doc/src/satelliteinfo.qdoc6
-rw-r--r--examples/positioning/weatherinfo/CMakeLists.txt54
-rw-r--r--examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc6
4 files changed, 31 insertions, 57 deletions
diff --git a/examples/positioning/satelliteinfo/CMakeLists.txt b/examples/positioning/satelliteinfo/CMakeLists.txt
index 21613877..dd90a6e1 100644
--- a/examples/positioning/satelliteinfo/CMakeLists.txt
+++ b/examples/positioning/satelliteinfo/CMakeLists.txt
@@ -35,17 +35,11 @@ target_link_libraries(satelliteinfo PRIVATE
Qt::Quick
)
-
-# Resources:
-set(satelliteinfo_resource_files
- "satelliteinfo.qml"
-)
-
-qt6_add_resources(satelliteinfo "satelliteinfo"
- PREFIX
- "/"
- FILES
- ${satelliteinfo_resource_files}
+qt_add_qml_module(satelliteinfo
+ URI Local
+ VERSION 1.0
+ QML_FILES satelliteinfo.qml
+ NO_RESOURCE_TARGET_PATH
)
install(TARGETS satelliteinfo
@@ -53,9 +47,3 @@ install(TARGETS satelliteinfo
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(satelliteinfo PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI Local
-)
-qt6_qml_type_registration(satelliteinfo)
diff --git a/examples/positioning/satelliteinfo/doc/src/satelliteinfo.qdoc b/examples/positioning/satelliteinfo/doc/src/satelliteinfo.qdoc
index 2136c440..fb314ea3 100644
--- a/examples/positioning/satelliteinfo/doc/src/satelliteinfo.qdoc
+++ b/examples/positioning/satelliteinfo/doc/src/satelliteinfo.qdoc
@@ -120,10 +120,8 @@
\c {CMakeLists.txt}:
\quotefromfile satelliteinfo/CMakeLists.txt
- \skipto set_target_properties
- \printuntil PROPERTIES
- \skipto QT_QML_MODULE_VERSION 1.0
- \printuntil qt6_qml_type_registration(satelliteinfo)
+ \skipto qt_add_qml_module(satelliteinfo
+ \printuntil )
\section2 qmake Build
diff --git a/examples/positioning/weatherinfo/CMakeLists.txt b/examples/positioning/weatherinfo/CMakeLists.txt
index 32225dc0..07407fd2 100644
--- a/examples/positioning/weatherinfo/CMakeLists.txt
+++ b/examples/positioning/weatherinfo/CMakeLists.txt
@@ -39,32 +39,28 @@ target_link_libraries(weatherinfo PRIVATE
Qt::Quick
)
-
-# Resources:
-set(weatherinfo_resource_files
- "components/BigForecastIcon.qml"
- "components/ForecastIcon.qml"
- "components/WeatherIcon.qml"
- "icons/weather-few-clouds.png"
- "icons/weather-fog.png"
- "icons/weather-haze.png"
- "icons/weather-icy.png"
- "icons/weather-overcast.png"
- "icons/weather-showers.png"
- "icons/weather-sleet.png"
- "icons/weather-snow.png"
- "icons/weather-storm.png"
- "icons/weather-sunny-very-few-clouds.png"
- "icons/weather-sunny.png"
- "icons/weather-thundershower.png"
- "weatherinfo.qml"
-)
-
-qt6_add_resources(weatherinfo "weatherinfo"
- PREFIX
- "/"
- FILES
- ${weatherinfo_resource_files}
+qt_add_qml_module(weatherinfo
+ URI WeatherInfo
+ VERSION 1.0
+ QML_FILES
+ components/BigForecastIcon.qml
+ components/ForecastIcon.qml
+ components/WeatherIcon.qml
+ weatherinfo.qml
+ RESOURCES
+ icons/weather-few-clouds.png
+ icons/weather-fog.png
+ icons/weather-haze.png
+ icons/weather-icy.png
+ icons/weather-overcast.png
+ icons/weather-showers.png
+ icons/weather-sleet.png
+ icons/weather-snow.png
+ icons/weather-storm.png
+ icons/weather-sunny-very-few-clouds.png
+ icons/weather-sunny.png
+ icons/weather-thundershower.png
+ NO_RESOURCE_TARGET_PATH
)
install(TARGETS weatherinfo
@@ -72,9 +68,3 @@ install(TARGETS weatherinfo
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(weatherinfo PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI WeatherInfo
-)
-qt6_qml_type_registration(weatherinfo)
diff --git a/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc b/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc
index f12d0216..12f0387e 100644
--- a/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc
+++ b/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc
@@ -105,10 +105,8 @@
\c {CMakeLists.txt}:
\quotefromfile weatherinfo/CMakeLists.txt
- \skipto set_target_properties
- \printuntil PROPERTIES
- \skipto QT_QML_MODULE_VERSION 1.0
- \printuntil qt6_qml_type_registration(weatherinfo)
+ \skipto qt_add_qml_module(weatherinfo
+ \printuntil )
\section2 qmake Build