Replace AUTO_RESOURCE_PREFIX with Qt CMake Policy in examples, tests

Every instance of AUTO_RESOURCE_PREFIX has been replaced by either
qt_standard_project_setup(REQUIRES 6.5) or with
qt_policy(SET QTP0001 NEW), mainly in tests.

In addition, I added a warning message for the case where
AUTO_RESOURCE_PREFIX is used.

Task-number: QTBUG-96233
Change-Id: I323a15e9d0bb5fe6ba649365314af9fc2ad67bda
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 8f7080fd09)
This commit is contained in:
Amir Masoud Abdol 2023-02-02 16:44:55 +01:00
parent 092ba09a8c
commit db81d9f549
67 changed files with 102 additions and 99 deletions

View File

@ -15,6 +15,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/dynamicscene")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(dynamicsceneexample WIN32 MACOSX_BUNDLE main.cpp)
target_link_libraries(dynamicsceneexample PUBLIC
@ -26,7 +28,6 @@ target_link_libraries(dynamicsceneexample PUBLIC
qt_add_qml_module(dynamicsceneexample
URI dynamicscene
AUTO_RESOURCE_PREFIX
QML_FILES
"GenericSceneItem.qml"
"PaletteItem.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/qmlextensionplugins/imports/T
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml)
qt_standard_project_setup(REQUIRES 6.5)
#![0]
set(qml_files
imports/TimeExample/Clock.qml
@ -37,7 +39,6 @@ qt_add_qml_module(qmlqtimeexample
OUTPUT_DIRECTORY imports/TimeExample
URI "TimeExample"
SOURCES timemodel.cpp timemodel.h
AUTO_RESOURCE_PREFIX
QML_FILES ${qml_files}
RESOURCES ${images}
)

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/xmlhttprequest")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(xmlhttprequestexample
WIN32
MACOSX_BUNDLE
@ -22,7 +24,6 @@ qt_add_executable(xmlhttprequestexample
qt_add_qml_module(xmlhttprequestexample
URI xmlhttprequest
AUTO_RESOURCE_PREFIX
QML_FILES
"methods.js"
"xmlhttprequest.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/animation")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(animationexample animation_shared)
qt_add_qml_module(animationexample
URI animation
AUTO_RESOURCE_PREFIX
QML_FILES
"animation.qml"
"basics/animators.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/canvas")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -31,7 +31,6 @@ target_link_libraries(canvasexample PRIVATE
qt_add_qml_module(canvasexample
URI canvas
AUTO_RESOURCE_PREFIX
QML_FILES
"LabeledSlider.qml"
"bezierCurve/bezierCurve.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/dialcontrol")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(dialcontrolexample
main.cpp
)
@ -32,7 +34,6 @@ target_link_libraries(dialcontrolexample PUBLIC
qt_add_qml_module(dialcontrolexample
URI dialcontrol
AUTO_RESOURCE_PREFIX
QML_FILES
"Dial.qml"
"QuitButton.qml"

View File

@ -15,6 +15,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/flipable")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(flipableexample
WIN32
MACOSX_BUNDLE
@ -30,7 +32,6 @@ target_link_libraries(flipableexample PUBLIC
qt_add_qml_module(flipableexample
URI flipable
AUTO_RESOURCE_PREFIX
QML_FILES
"flipable.qml"
"Card.qml"

View File

@ -15,13 +15,14 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/painteditem")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory(TextBalloon)
qt_add_executable(painteditemexample WIN32 MACOSX_BUNDLE main.cpp)
qt_add_qml_module(painteditemexample
URI painteditem
AUTO_RESOURCE_PREFIX
QML_FILES
"textballoons.qml"
)

View File

@ -10,7 +10,6 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/painteditem/Tex
qt_add_qml_module(qmltextballoon
URI "TextBalloon"
PLUGIN_TARGET qmltextballoon
AUTO_RESOURCE_PREFIX
SOURCES
textballoon.cpp textballoon.h
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/delegatechooser")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -29,7 +29,6 @@ add_dependencies(delegatechooserexample delegatechooser_shared)
qt_add_qml_module(delegatechooserexample
URI delegatechooser
AUTO_RESOURCE_PREFIX
QML_FILES
"delegatechooser.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/draganddrop")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -24,7 +24,6 @@ qt_add_executable(draganddropexample
qt_add_qml_module(draganddropexample
URI draganddrop
AUTO_RESOURCE_PREFIX
QML_FILES
"draganddrop.qml"
"tiles/DragTile.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/embeddedinwidgets")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Widgets)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(embeddedinwidgetsexample WIN32 MACOSX_BUNDLE
main.cpp
@ -28,7 +28,6 @@ target_link_libraries(embeddedinwidgetsexample PRIVATE
# Resources:
qt_add_qml_module(embeddedinwidgetsexample
URI embeddedinwidgets
AUTO_RESOURCE_PREFIX
QML_FILES
"main.qml"
RESOURCES

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/externaldraganddrop")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(externaldraganddropexample
WIN32
@ -22,7 +22,6 @@ qt_add_executable(externaldraganddropexample
qt_add_qml_module(externaldraganddropexample
URI externaldraganddrop
AUTO_RESOURCE_PREFIX
QML_FILES
"DragAndDropTextItem.qml"
"externaldraganddrop.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/imageelements")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -31,7 +31,6 @@ target_link_libraries(imageelementsexample PRIVATE
qt_add_qml_module(imageelementsexample
URI imageelements
AUTO_RESOURCE_PREFIX
QML_FILES
"animatedimage.qml"
"animatedsprite.qml"

View File

@ -15,9 +15,10 @@ set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples/quick/imageprovider)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt6_add_qml_module(qmlimageproviderplugin
URI "ImageProviderCore"
AUTO_RESOURCE_PREFIX
PLUGIN_TARGET qmlimageproviderplugin
NO_PLUGIN_OPTIONAL
NO_GENERATE_PLUGIN_SOURCE

View File

@ -15,9 +15,10 @@ set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/examples/quick/imageresponseprov
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt6_add_qml_module(qmlimageresponseproviderplugin
URI "ImageResponseProviderCore"
AUTO_RESOURCE_PREFIX
PLUGIN_TARGET qmlimageresponseproviderplugin
NO_PLUGIN_OPTIONAL
NO_GENERATE_PLUGIN_SOURCE

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/itemvariablerefreshrate")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(itemvariablerefreshrateexample
WIN32
@ -29,7 +29,6 @@ target_link_libraries(itemvariablerefreshrateexample PRIVATE
qt_add_qml_module(itemvariablerefreshrateexample
URI itemvariablerefreshrate
AUTO_RESOURCE_PREFIX
QML_FILES
"itemvariablerefreshrate.qml"
RESOURCES

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/keyinteraction")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(keyinteractionexample WIN32 MACOSX_BUNDLE
main.cpp
@ -28,7 +28,6 @@ target_link_libraries(keyinteractionexample PRIVATE
# Resources:
qt_add_qml_module(keyinteractionexample
URI keyinteraction
AUTO_RESOURCE_PREFIX
QML_FILES
"ContextMenu.qml"
"GridMenu.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/layouts")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(layoutsexample
WIN32
@ -22,7 +22,6 @@ qt_add_executable(layoutsexample
qt_add_qml_module(layoutsexample
URI layouts
AUTO_RESOURCE_PREFIX
QML_FILES
"layouts.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/localstorage")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(localstorageexample
WIN32
@ -22,7 +22,6 @@ qt_add_executable(localstorageexample
qt_add_qml_module(localstorageexample
URI localstorage
AUTO_RESOURCE_PREFIX
QML_FILES
"Database.js"
"Header.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/models/abstractitemmodel")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(abstractitemmodelexample WIN32 MACOSX_BUNDLE
main.cpp
@ -29,7 +29,6 @@ target_link_libraries(abstractitemmodelexample PRIVATE
# Resources:
qt_add_qml_module(abstractitemmodelexample
URI abstractitemmodel
AUTO_RESOURCE_PREFIX
QML_FILES
"view.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/models/objectlistmodel")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(objectlistmodelexample WIN32 MACOSX_BUNDLE
dataobject.cpp dataobject.h
@ -29,7 +29,6 @@ target_link_libraries(objectlistmodelexample PRIVATE
# Resources:
qt_add_qml_module(objectlistmodelexample
URI objectlistmodel
AUTO_RESOURCE_PREFIX
QML_FILES
"view.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/models/stringlistmodel")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(stringlistmodelexample WIN32 MACOSX_BUNDLE
main.cpp
@ -28,7 +28,6 @@ target_link_libraries(stringlistmodelexample PRIVATE
# Resources:
qt_add_qml_module(stringlistmodelexample
URI stringlistmodel
AUTO_RESOURCE_PREFIX
QML_FILES
"view.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/mousearea")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(mouseareaexample WIN32 MACOSX_BUNDLE
main.cpp
@ -28,7 +28,6 @@ target_link_libraries(mouseareaexample PRIVATE
# Resources:
qt_add_qml_module(mouseareaexample
URI mousearea
AUTO_RESOURCE_PREFIX
QML_FILES
"mousearea-wheel-example.qml"
"mousearea.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/multieffect/itemswitcher")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(itemswitcherexample itemswitcher_shared)
# Resources:
qt_add_qml_module(itemswitcherexample
URI itemswitcher
AUTO_RESOURCE_PREFIX
QML_FILES
"qml/main.qml"
"qml/PagesView.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/multieffect/testbed")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(testbedexample testbed_shared)
# Resources:
qt_add_qml_module(testbedexample
URI testbed
AUTO_RESOURCE_PREFIX
QML_FILES
"qml/FpsItem.qml"
"qml/main.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/affectors")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -32,7 +32,6 @@ add_dependencies(affectorsexample affectors_shared)
# Resources:
qt_add_qml_module(affectorsexample
URI affectors
AUTO_RESOURCE_PREFIX
QML_FILES
"affectors.qml"
"GreyButton.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/emitters")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -32,7 +32,6 @@ add_dependencies(emittersexample emitters_shared)
# Resources:
qt_add_qml_module(emittersexample
URI emitters
AUTO_RESOURCE_PREFIX
QML_FILES
"burstandpulse.qml"
"customemitter.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/imageparticle")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -32,7 +32,6 @@ add_dependencies(imageparticleexample imageparticle_shared)
# Resources:
qt_add_qml_module(imageparticleexample
URI imageparticle
AUTO_RESOURCE_PREFIX
QML_FILES
"allatonce.qml"
"colored.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/itemparticle")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -32,7 +32,6 @@ add_dependencies(itemparticleexample itemparticle_shared)
# Resources:
qt_add_qml_module(itemparticleexample
URI itemparticle
AUTO_RESOURCE_PREFIX
QML_FILES
"itemparticle.qml"
"delegates.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/particles/system")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../../shared" "shared")
@ -32,7 +32,6 @@ add_dependencies(systemexample system_shared)
# Resources:
qt_add_qml_module(systemexample
URI system
AUTO_RESOURCE_PREFIX
QML_FILES
"dynamiccomparison.qml"
"dynamicemitters.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/pointerhandlers")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Svg)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -30,7 +30,6 @@ add_dependencies(pointerhandlersexample pointerhandlers_shared)
qt_add_qml_module(pointerhandlersexample
URI pointerhandlers
AUTO_RESOURCE_PREFIX
QML_FILES
"components/Button.qml"
"components/CheckBox.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/positioners")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -24,7 +24,6 @@ qt_add_executable(positionersexample
qt_add_qml_module(positionersexample
URI positioners
AUTO_RESOURCE_PREFIX
QML_FILES
"positioners-attachedproperties.qml"
"positioners-transitions.qml"

View File

@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/quick-accessibility")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(quick-accessibility
WIN32
@ -31,7 +31,6 @@ target_link_libraries(quick-accessibility PRIVATE
qt_add_qml_module(quick-accessibility
URI accessibility
AUTO_RESOURCE_PREFIX
QML_FILES
"accessibility.qml"
"Button.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/rendercontrol/rendercontrol
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(rendercontrol_d3d11example WIN32 MACOSX_BUNDLE
engine.cpp engine.h
main.cpp
@ -34,7 +36,6 @@ target_link_libraries(rendercontrol_d3d11example PUBLIC
# Resources:
qt_add_qml_module(rendercontrol_d3d11example
URI rendercontrol
AUTO_RESOURCE_PREFIX
QML_FILES
"demo.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/rendercontrol/rendercontrol
find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(rendercontrol_openglexample WIN32 MACOSX_BUNDLE
cuberenderer.cpp cuberenderer.h
@ -31,7 +31,6 @@ target_link_libraries(rendercontrol_openglexample PRIVATE
# Resources:
qt_add_qml_module(rendercontrol_openglexample
URI rendercontrol
AUTO_RESOURCE_PREFIX
QML_FILES
"demo.qml"
)

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/righttoleft")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -24,7 +24,6 @@ qt_add_executable(righttoleftexample
qt_add_qml_module(righttoleftexample
URI righttoleft
AUTO_RESOURCE_PREFIX
QML_FILES
"layoutdirection/layoutdirection.qml"
"layoutmirroring/layoutmirroring.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/shadereffects")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick ShaderTools)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(shadereffectsexample
WIN32
@ -29,7 +29,6 @@ target_link_libraries(shadereffectsexample PRIVATE
qt_add_qml_module(shadereffectsexample
URI shadereffects
AUTO_RESOURCE_PREFIX
QML_FILES
"shadereffects.qml"
RESOURCES

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/shapes")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(shapesexample shapes_shared)
qt_add_qml_module(shapesexample
URI shapes
AUTO_RESOURCE_PREFIX
QML_FILES
"clippedtigers.qml"
"interactive.qml"

View File

@ -16,7 +16,6 @@ qt_add_qml_module(${PROJECT_NAME}_shared
URI shared
VERSION 2.2
PLUGIN_TARGET ${PROJECT_NAME}_shared
AUTO_RESOURCE_PREFIX
SOURCES
"shared.h"
QML_FILES

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/text")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(textexample text_shared)
qt_add_qml_module(textexample
URI text
AUTO_RESOURCE_PREFIX
QML_FILES
"fonts/availableFonts.qml"
"fonts/banner.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/threading")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(threadingexample threading_shared)
qt_add_qml_module(threadingexample
URI threading
AUTO_RESOURCE_PREFIX
QML_FILES
"threadedlistmodel/dataloader.mjs"
"threadedlistmodel/timedisplay.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/touchinteraction")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -33,7 +33,6 @@ add_dependencies(touchinteractionexample touchinteraction_shared)
qt_add_qml_module(touchinteractionexample
URI touchinteraction
AUTO_RESOURCE_PREFIX
QML_FILES
"flickable/Panel.qml"
"flickable/basic-flickable.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynam
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(dynamicview1
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(dynamicview1 PROPERTIES
qt_add_qml_module(dynamicview1
URI dynamicview
AUTO_RESOURCE_PREFIX
QML_FILES
dynamicview.qml
PetsModel.qml

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynam
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(dynamicview2
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(dynamicview2 PROPERTIES
qt_add_qml_module(dynamicview2
URI dynamicview
AUTO_RESOURCE_PREFIX
QML_FILES
dynamicview.qml
PetsModel.qml

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynam
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(dynamicview3
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(dynamicview3 PROPERTIES
qt_add_qml_module(dynamicview3
URI dynamicview
AUTO_RESOURCE_PREFIX
QML_FILES
dynamicview.qml
PetsModel.qml

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/dynamicview/dynam
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(dynamicview4
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(dynamicview4 PROPERTIES
qt_add_qml_module(dynamicview4
URI dynamicview
AUTO_RESOURCE_PREFIX
QML_FILES
dynamicview.qml
ListSelector.qml

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(samegame1
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(samegame1 PROPERTIES
qt_add_qml_module(samegame1
URI samegame
AUTO_RESOURCE_PREFIX
QML_FILES
"Block.qml"
"Button.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(samegame2
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(samegame2 PROPERTIES
qt_add_qml_module(samegame2
URI samegame
AUTO_RESOURCE_PREFIX
QML_FILES
"Block.qml"
"Button.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(samegame3
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(samegame3 PROPERTIES
qt_add_qml_module(samegame3
URI samegame
AUTO_RESOURCE_PREFIX
QML_FILES
"Block.qml"
"Button.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(samegame4
main.cpp
)
@ -25,7 +27,6 @@ set_target_properties(samegame4 PROPERTIES
qt_add_qml_module(samegame4
URI samegame
AUTO_RESOURCE_PREFIX
QML_FILES
"BoomBlock.qml"
"Button.qml"

View File

@ -14,6 +14,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/views")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
qt_add_executable(viewsexample
@ -36,7 +38,6 @@ add_dependencies(viewsexample views_shared)
qt_add_qml_module(viewsexample
URI views
AUTO_RESOURCE_PREFIX
QML_FILES
"delegatemodel/dragselection.qml"
"delegatemodel/slideshow.qml"

View File

@ -12,7 +12,7 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/window")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory("../shared" "shared")
@ -31,7 +31,6 @@ target_link_libraries(windowexample PRIVATE
qt_add_qml_module(windowexample
URI window
AUTO_RESOURCE_PREFIX
QML_FILES
"AllScreens.qml"
"CurrentScreen.qml"

View File

@ -10,7 +10,8 @@ endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols/attachedstyleproperties")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml QuickControls2)
qt_standard_project_setup()
qt_standard_project_setup(REQUIRES 6.5)
add_subdirectory(MyStyle)

View File

@ -429,6 +429,11 @@ function(qt6_add_qml_module target)
)
else()
set(arg_RESOURCE_PREFIX "/qt/qml")
message(DEPRECATION "AUTO_RESOURCE_PREFIX is deprecated. "
"Please use the qt_policy(SET) command to set the QTP0001 policy, "
"or use the qt_standard_project_setup() command to set your preferred "
"REQUIRES to get the preferred behavior. "
"Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0001.html for policy details.")
endif()
elseif(arg_RESOURCE_PREFIX)
_qt_internal_canonicalize_resource_path("${arg_RESOURCE_PREFIX}" arg_RESOURCE_PREFIX)

View File

@ -17,11 +17,12 @@ qt_add_library(testCppTypes STATIC)
qt_autogen_tools_initial_setup(testCppTypes)
target_link_libraries(testCppTypes PRIVATE Qt::Qml Qt::QmlPrivate Qt::Quick)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(testCppTypes
URI TestTypes
SOURCES
commontypes.h
AUTO_RESOURCE_PREFIX
OUTPUT_DIRECTORY TestTypes
)
qt_autogen_tools_initial_setup(testCppTypesplugin)

View File

@ -223,11 +223,12 @@ set_target_properties(codegen_test_module PROPERTIES
QT_QMLCACHEGEN_EXECUTABLE qmlcachegen
)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(codegen_test_module
VERSION 1.5
URI TestTypes
IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/imports/"
AUTO_RESOURCE_PREFIX
DEPENDENCIES
QtQuick
QtQuick.Templates

View File

@ -24,9 +24,10 @@ qt_autogen_tools_initial_setup(tst_qmlsplitlib)
qt6_generate_foreign_qml_types(tst_qmlsplitlib_library tst_qmlsplitlib)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(tst_qmlsplitlib
URI "SplitLib"
AUTO_RESOURCE_PREFIX
QML_FILES
main.qml
)

View File

@ -164,10 +164,11 @@ qt_internal_add_resource(qmltc_test_module "qmake_immediate"
${qmake_immediate_resource_files}
)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(qmltc_test_module
VERSION 1.0
URI QmltcTests
AUTO_RESOURCE_PREFIX
SOURCES
${cpp_sources}
QML_FILES

View File

@ -19,9 +19,10 @@ qt_internal_add_test(tst_qmltc_manual
TESTDATA ${test_data}
)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(tst_qmltc_manual
URI "QmltcManualTests"
AUTO_RESOURCE_PREFIX
QML_FILES
${test_data}
)

View File

@ -14,10 +14,11 @@ qt_internal_add_test(tst_qmltc_qprocess
set_source_files_properties(data/SingletonThing.qml data/singletonUncreatable.qml
PROPERTIES QT_QML_SINGLETON_TYPE true)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(tst_qmltc_qprocess
VERSION 1.0
URI QmltcQProcessTests
AUTO_RESOURCE_PREFIX
SOURCES
cpptypes/testtype.h
DEPENDENCIES

View File

@ -76,9 +76,11 @@ qt_add_library(tst-qmltyperegistrar-with-dashes)
qt_autogen_tools_initial_setup(tst-qmltyperegistrar-with-dashes)
target_link_libraries(tst-qmltyperegistrar-with-dashes PRIVATE Qt::Core Qt::Qml)
qt_enable_autogen_tool(tst-qmltyperegistrar-with-dashes "moc" ON)
qt_policy(SET QTP0001 NEW)
qt_add_qml_module(tst-qmltyperegistrar-with-dashes
URI Module-With-Dashes
AUTO_RESOURCE_PREFIX
SOURCES
foo.cpp foo.h
OUTPUT_DIRECTORY Module-With-Dashes

View File

@ -2,13 +2,15 @@
# SPDX-License-Identifier: BSD-3-Clause
# Use NO_GENERATE_QMLTYPES to avoid static asserts during compilation of the types to be tested, same for NO_PLUGIN
qt_policy(SET QTP0001 NEW)
qt_add_qml_module(UnregisteredTypes
STATIC
URI UnregisteredTypes
NO_GENERATE_QMLTYPES
NO_PLUGIN
SOURCES uncreatable.h
AUTO_RESOURCE_PREFIX
)
qt_enable_autogen_tool(UnregisteredTypes "moc" ON)

View File

@ -36,10 +36,11 @@ if(TARGET Qt::QuickControls2)
target_compile_definitions(tst_qqmlcomponent PRIVATE HAS_CONTROLS)
endif()
qt_policy(SET QTP0001 NEW)
qt_add_qml_module(
tst_qqmlcomponent
URI test
AUTO_RESOURCE_PREFIX
QML_FILES
"data/TestComponentWithIC.qml"
"data/withAot.qml"

View File

@ -8,9 +8,10 @@ qt_autogen_tools_initial_setup(qqmljsscope_test_module)
target_include_directories(qqmljsscope_test_module PUBLIC cpptypes/)
target_link_libraries(qqmljsscope_test_module PUBLIC Qt::Core Qt::Qml Qt::Gui)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(qqmljsscope_test_module
URI QQmlJSScopeTests
AUTO_RESOURCE_PREFIX
SOURCES
singleton.h singleton.cpp
extensiontypes.h

View File

@ -40,7 +40,8 @@ qt_internal_add_shaders(tst_qquickitemrhiintegration "shaders"
"texture.frag"
)
qt_policy(SET QTP0001 NEW)
qt_add_qml_module(tst_qquickitemrhiintegration
URI TestQquickitemrhiintegration
AUTO_RESOURCE_PREFIX
)

View File

@ -23,9 +23,10 @@ qt_internal_add_test(tst_qquicklistview2
TESTDATA ${test_data}
)
qt_policy(SET QTP0001 NEW)
qt6_add_qml_module(tst_qquicklistview2
URI Test
AUTO_RESOURCE_PREFIX
)
qt_internal_extend_target(tst_qquicklistview2 CONDITION ANDROID OR IOS