diff options
Diffstat (limited to 'examples')
5 files changed, 32 insertions, 40 deletions
diff --git a/examples/qml/qmlextensionplugins/CMakeLists.txt b/examples/qml/qmlextensionplugins/CMakeLists.txt index 7fc2b7268f..dcfde4a8ae 100644 --- a/examples/qml/qmlextensionplugins/CMakeLists.txt +++ b/examples/qml/qmlextensionplugins/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from qmlextensionplugins.pro. cmake_minimum_required(VERSION 3.14) -project(qmlqtimeexampleplugin LANGUAGES CXX) +project(qmlqtimeexample LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -19,37 +19,38 @@ find_package(Qt6 COMPONENTS Core) find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Qml) -qt6_add_qml_module(qmlqtimeexampleplugin +set_source_files_properties(imports/TimeExample/Clock.qml PROPERTIES + QT_RESOURCE_ALIAS Clock.qml +) +qt6_add_qml_module(qmlqtimeexample OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/imports/TimeExample" VERSION 1.0 URI "TimeExample" - INSTALL_LOCATION ${INSTALL_EXAMPLEDIR} -) - -target_sources(qmlqtimeexampleplugin PRIVATE - plugin.cpp - timemodel.cpp timemodel.h + SOURCES timemodel.cpp timemodel.h + QML_FILES imports/TimeExample/Clock.qml ) -set_target_properties(qmlqtimeexampleplugin PROPERTIES +set_target_properties(qmlqtimeexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(qmlqtimeexampleplugin PUBLIC +target_link_libraries(qmlqtimeexample PUBLIC Qt::Core Qt::Gui Qt::Qml ) -install(TARGETS qmlqtimeexampleplugin +qt6_add_resources(qmlqtimeexample example_images + PREFIX "/TimeExample" + BASE imports/TimeExample + FILES + imports/TimeExample/center.png + imports/TimeExample/clock.png + imports/TimeExample/hour.png + imports/TimeExample/minute.png +) + +install(TARGETS qmlqtimeexample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -set_target_properties(qmlqtimeexampleplugin PROPERTIES - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI TimeExample - QT_QMLTYPES_FILENAME imports/TimeExample/plugins.qmltypes -) - -qt6_qml_type_registration(qmlqtimeexampleplugin) 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) diff --git a/examples/quick/customitems/painteditem/CMakeLists.txt b/examples/quick/customitems/painteditem/CMakeLists.txt index 533396a7cd..fa964778d0 100644 --- a/examples/quick/customitems/painteditem/CMakeLists.txt +++ b/examples/quick/customitems/painteditem/CMakeLists.txt @@ -24,11 +24,12 @@ qt6_add_qml_module(qmltextballoonplugin OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/TextBalloonPlugin" VERSION 1.0 URI "TextBalloonPlugin" - INSTALL_LOCATION ${INSTALL_EXAMPLEDIR} + PLUGIN_TARGET qmltextballoonplugin + QML_FILES textballoons.qml + RESOURCE_PREFIX "/painteditem" ) target_sources(qmltextballoonplugin PRIVATE - TextBalloonPlugin/plugin.h textballoon.cpp textballoon.h ) set_target_properties(qmltextballoonplugin PROPERTIES @@ -46,7 +47,6 @@ target_link_libraries(qmltextballoonplugin PUBLIC # Resources: set(painteditem_resource_files "textballoon.h" - "textballoons.qml" ) qt6_add_resources(qmltextballoonplugin "painteditem" @@ -61,10 +61,3 @@ install(TARGETS qmltextballoonplugin BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -set_target_properties(qmltextballoonplugin PROPERTIES - QT_QML_MODULE_VERSION 1.0 - QT_QML_MODULE_URI TextBalloonPlugin -) - -qt6_qml_type_registration(qmltextballoonplugin) diff --git a/examples/quick/imageprovider/CMakeLists.txt b/examples/quick/imageprovider/CMakeLists.txt index e3318b0755..5a25a45deb 100644 --- a/examples/quick/imageprovider/CMakeLists.txt +++ b/examples/quick/imageprovider/CMakeLists.txt @@ -24,7 +24,10 @@ qt6_add_qml_module(qmlimageproviderplugin OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ImageProviderCore" VERSION 1.0 URI "ImageProviderCore" - INSTALL_LOCATION ${INSTALL_EXAMPLEDIR} + PLUGIN_TARGET qmlimageproviderplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + CLASS_NAME ImageProviderExtensionPlugin ) target_sources(qmlimageproviderplugin PRIVATE diff --git a/examples/quick/imageresponseprovider/CMakeLists.txt b/examples/quick/imageresponseprovider/CMakeLists.txt index 5f282a0fb9..551ce01197 100644 --- a/examples/quick/imageresponseprovider/CMakeLists.txt +++ b/examples/quick/imageresponseprovider/CMakeLists.txt @@ -24,7 +24,10 @@ qt6_add_qml_module(qmlimageresponseproviderplugin OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ImageResponseProviderCore" VERSION 1.0 URI "ImageResponseProviderCore" - INSTALL_LOCATION ${INSTALL_EXAMPLEDIR} + PLUGIN_TARGET qmlimageresponseproviderplugin + NO_PLUGIN_OPTIONAL + NO_GENERATE_PLUGIN_SOURCE + CLASS_NAME ImageProviderExtensionPlugin ) target_sources(qmlimageresponseproviderplugin PRIVATE |