aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qml/tutorials/extending-qml
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-06-02 16:54:21 +1000
committerCraig Scott <craig.scott@qt.io>2021-06-04 16:54:52 +1000
commit1c4ba17015fe99da48ce73fab75ecc60cf9cb975 (patch)
tree1311d8cebc4007d43888477045ca534404f2f7ca /examples/qml/tutorials/extending-qml
parent6432e00b954beec7d0c6bc9b70fed6191b87bd38 (diff)
Refactor and update qml CMake API
The existing CMake API for qml modules had a number of shortcomings. Refactor it to achieve the following: - Clearly separate public and internal aspects. - Re-use code from qtbase for adding plugins and module targets rather than reimplementing close variations. - Provide more robust and complete support for qmllint, qmlcachegen and automatic generation of qmldir files. - Reduce the steps needed for more common scenarios. - Encourage the use of separate backing library and plugin targets. - Automatically generate the plugin class .cpp file where possible. - Specify .qml files directly through qml-specific API elements rather than assuming they can be extracted out of a set of resources. [ChangeLog][QtQml] The qml CMake API has changed from 6.1 and is now out of Technical Preview status. The most notable change is that .qml files should no longer be specified as resources, there is dedicated handling for them in the qt6_add_qml_module(). A related change is that the qt6_target_qml_files() command has been replaced by qt6_target_qml_sources(). More complete integration with qmlcachegen, qmllint and qmldir generation is also part of the CMake API. Fixes: QTBUG-91621 Task-number: QTBUG-82598 Task-number: QTBUG-88763 Task-number: QTBUG-89274 Task-number: QTBUG-91444 Change-Id: I25aae1b0e89890394dfe2ba2824008164b2ca8d9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/qml/tutorials/extending-qml')
-rw-r--r--examples/qml/tutorials/extending-qml/chapter6-plugins/import/CMakeLists.txt10
1 files changed, 1 insertions, 9 deletions
diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/CMakeLists.txt
index ad3a5972e8..f75028aa69 100644
--- a/examples/qml/tutorials/extending-qml/chapter6-plugins/import/CMakeLists.txt
+++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/import/CMakeLists.txt
@@ -24,11 +24,10 @@ qt6_add_qml_module(chartsplugin
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../Charts"
VERSION 1.0
URI "Charts"
- INSTALL_LOCATION ${INSTALL_EXAMPLEDIR}
+ PLUGIN_TARGET chartsplugin
)
target_sources(chartsplugin PRIVATE
- chartsplugin.h
piechart.cpp piechart.h
pieslice.cpp pieslice.h
)
@@ -48,10 +47,3 @@ install(TARGETS chartsplugin
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
-
-set_target_properties(chartsplugin PROPERTIES
- QT_QML_MODULE_VERSION 1.0
- QT_QML_MODULE_URI Charts
-)
-
-qt6_qml_type_registration(chartsplugin)