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
Pick-to: 6.2
Change-Id: I3f1814a29af608461daa90477eca0aa2304eb9d1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Craig Scott 2021-08-23 18:26:06 +10:00
parent 9e1d2a0eb1
commit a86fd709dd
20 changed files with 166 additions and 485 deletions

View File

@ -35,20 +35,17 @@ target_link_libraries(maskedmousearea PUBLIC
Qt::Quick
)
# Resources:
set(maskedmousearea_resource_files
"images/cloud_1.png"
"images/cloud_2.png"
"images/moon.png"
"maskedmousearea.qml"
)
qt6_add_resources(maskedmousearea "maskedmousearea"
PREFIX
"/customitems/maskedmousearea"
FILES
${maskedmousearea_resource_files}
qt_add_qml_module(maskedmousearea
URI Example
VERSION 1.0
QML_FILES
maskedmousearea.qml
RESOURCES
images/cloud_1.png
images/cloud_2.png
images/moon.png
RESOURCE_PREFIX /customitems/maskedmousearea
NO_RESOURCE_TARGET_PATH
)
install(TARGETS maskedmousearea
@ -56,10 +53,3 @@ install(TARGETS maskedmousearea
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(maskedmousearea PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI Example
)
qt6_qml_type_registration(maskedmousearea)

View File

@ -39,28 +39,15 @@ target_link_libraries(qquickviewcomparison PUBLIC
Qt::Widgets
)
# Resources:
set(qquickviewcomparison_resource_files
"test.qml"
qt_add_qml_module(qquickviewcomparison
URI fbitem
VERSION 1.0
QML_FILES test.qml
RESOURCE_PREFIX /qquickviewcomparison
NO_RESOURCE_TARGET_PATH
)
qt6_add_resources(qquickviewcomparison "qquickviewcomparison"
PREFIX
"/qquickviewcomparison"
FILES
${qquickviewcomparison_resource_files}
)
install(TARGETS qquickviewcomparison
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(qquickviewcomparison PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI fbitem
)
qt6_qml_type_registration(qquickviewcomparison)

View File

@ -37,19 +37,15 @@ target_link_libraries(quickwidget PUBLIC
Qt::Widgets
)
# Resources:
set(quickwidget_resource_files
"customgl.qml"
"rotatingsquare.qml"
"rotatingsquaretab.qml"
)
qt6_add_resources(quickwidget "quickwidget"
PREFIX
"/quickwidget"
FILES
${quickwidget_resource_files}
qt_add_qml_module(quickwidget
URI QuickWidgetExample
VERSION 1.0
QML_FILES
customgl.qml
rotatingsquare.qml
rotatingsquaretab.qml
RESOURCE_PREFIX /quickwidget
NO_RESOURCE_TARGET_PATH
)
install(TARGETS quickwidget
@ -57,10 +53,3 @@ install(TARGETS quickwidget
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(quickwidget PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI QuickWidgetExample
)
qt6_qml_type_registration(quickwidget)

View File

@ -1,22 +0,0 @@
# Generated from scenegraph.pro.
add_subdirectory(customgeometry)
add_subdirectory(custommaterial)
add_subdirectory(graph)
add_subdirectory(threadedanimation)
add_subdirectory(twotextureproviders)
if(QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3)
add_subdirectory(fboitem)
add_subdirectory(openglunderqml)
endif()
if(IOS OR MACOS)
add_subdirectory(metalunderqml)
add_subdirectory(metaltextureimport)
endif()
if(WIN32)
add_subdirectory(d3d11underqml)
endif()
if(QT_FEATURE_vulkan)
add_subdirectory(vulkanunderqml)
add_subdirectory(vulkantextureimport)
endif()

View File

@ -1,60 +0,0 @@
# Generated from customgeometry.pro.
cmake_minimum_required(VERSION 3.14)
project(customgeometry LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/customgeometry")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
qt_add_executable(customgeometry
beziercurve.cpp beziercurve.h
main.cpp
)
set_target_properties(customgeometry PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
target_link_libraries(customgeometry PUBLIC
Qt::Core
Qt::Gui
Qt::Quick
)
# Resources:
set(customgeometry_resource_files
"main.qml"
)
qt6_add_resources(customgeometry "customgeometry"
PREFIX
"/scenegraph/customgeometry"
FILES
${customgeometry_resource_files}
)
install(TARGETS customgeometry
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(customgeometry PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI CustomGeometry
)
qt6_qml_type_registration(customgeometry)

View File

@ -33,17 +33,12 @@ target_link_libraries(customgeometry_declarative PUBLIC # special case
Qt::Quick
)
# Resources:
set(customgeometry_resource_files
"main.qml"
)
qt6_add_resources(customgeometry_declarative "customgeometry" # special case
PREFIX
"/scenegraph/customgeometry"
FILES
${customgeometry_resource_files}
qt_add_qml_module(customgeometry_declarative
URI CustomGeometry
VERSION 1.0
QML_FILES main.qml
RESOURCE_PREFIX /scenegraph/customgeometry
NO_RESOURCE_TARGET_PATH
)
install(TARGETS customgeometry_declarative # special case
@ -51,10 +46,3 @@ install(TARGETS customgeometry_declarative # special case
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(customgeometry_declarative PROPERTIES # special case
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI CustomGeometry
)
qt6_qml_type_registration(customgeometry_declarative) # special case

View File

@ -1,64 +0,0 @@
# Generated from custommaterial.pro.
cmake_minimum_required(VERSION 3.14)
project(custommaterial LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/scenegraph/custommaterial")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Qml)
find_package(Qt6 COMPONENTS Quick)
qt_add_executable(custommaterial
customitem.cpp customitem.h
main.cpp
)
set_target_properties(custommaterial PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
target_link_libraries(custommaterial PUBLIC
Qt::Core
Qt::Gui
Qt::Qml
Qt::Quick
)
# Resources:
set(custommaterial_resource_files
"main.qml"
"shaders/mandelbrot.frag.qsb"
"shaders/mandelbrot.vert.qsb"
)
qt6_add_resources(custommaterial "custommaterial"
PREFIX
"/scenegraph/custommaterial"
FILES
${custommaterial_resource_files}
)
install(TARGETS custommaterial
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(custommaterial PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI ExampleCustomMaterial
)
qt6_qml_type_registration(custommaterial)

View File

@ -35,19 +35,16 @@ target_link_libraries(custommaterial_declarative PUBLIC # special case
Qt::Quick
)
# Resources:
set(custommaterial_resource_files
"main.qml"
"shaders/mandelbrot.frag.qsb"
"shaders/mandelbrot.vert.qsb"
)
qt6_add_resources(custommaterial_declarative "custommaterial" # special case
PREFIX
"/scenegraph/custommaterial"
FILES
${custommaterial_resource_files}
qt_add_qml_module(custommaterial_declarative
URI ExampleCustomMaterial
VERSION 1.0
QML_FILES
main.qml
RESOURCES
shaders/mandelbrot.frag.qsb
shaders/mandelbrot.vert.qsb
RESOURCE_PREFIX /scenegraph/custommaterial
NO_RESOURCE_TARGET_PATH
)
install(TARGETS custommaterial_declarative # special case
@ -55,10 +52,3 @@ install(TARGETS custommaterial_declarative # special case
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(custommaterial_declarative PROPERTIES # special case
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI ExampleCustomMaterial
)
qt6_qml_type_registration(custommaterial_declarative) # special case

View File

@ -37,19 +37,16 @@ target_link_libraries(d3d11underqml PUBLIC
d3dcompiler
)
# Resources:
set(d3d11underqml_resource_files
"main.qml"
"squircle.frag"
"squircle.vert"
)
qt6_add_resources(d3d11underqml "d3d11underqml"
PREFIX
"/scenegraph/d3d11underqml"
FILES
${d3d11underqml_resource_files}
qt_add_qml_module(d3d11underqml
URI D3D11UnderQML
VERSION 1.0
QML_FILES
main.qml
RESOURCES
squircle.frag
squircle.vert
RESOURCE_PREFIX /scenegraph/d3d11underqml
NO_RESOURCE_TARGET_PATH
)
install(TARGETS d3d11underqml
@ -57,10 +54,3 @@ install(TARGETS d3d11underqml
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(d3d11underqml PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI D3D11UnderQML
)
qt6_qml_type_registration(d3d11underqml)

View File

@ -40,18 +40,13 @@ target_link_libraries(fboitem PUBLIC
Qt::Quick
)
# Resources:
set(fboitem_resource_files
"main.qml"
"shaders/checker.frag.qsb"
)
qt6_add_resources(fboitem "fboitem"
PREFIX
"/scenegraph/fboitem"
FILES
${fboitem_resource_files}
qt_add_qml_module(fboitem
URI SceneGraphRendering
VERSION 1.0
QML_FILES main.qml
RESOURCES shaders/checker.frag.qsb
RESOURCE_PREFIX /scenegraph/fboitem
NO_RESOURCE_TARGET_PATH
)
install(TARGETS fboitem
@ -59,10 +54,3 @@ install(TARGETS fboitem
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(fboitem PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI SceneGraphRendering
)
qt6_qml_type_registration(fboitem)

View File

@ -29,6 +29,9 @@ qt_add_executable(graph
set_target_properties(graph PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME graphapp
)
target_link_libraries(graph PUBLIC
Qt::Core
@ -36,21 +39,18 @@ target_link_libraries(graph PUBLIC
Qt::Quick
)
# Resources:
set(graph_resource_files
"main.qml"
"shaders/line.frag.qsb"
"shaders/line.vert.qsb"
"shaders/noisy.frag.qsb"
"shaders/noisy.vert.qsb"
)
qt6_add_resources(graph "graph"
PREFIX
"/scenegraph/graph"
FILES
${graph_resource_files}
qt_add_qml_module(graph
URI Graph
VERSION 1.0
QML_FILES
main.qml
RESOURCES
shaders/line.frag.qsb
shaders/line.vert.qsb
shaders/noisy.frag.qsb
shaders/noisy.vert.qsb
RESOURCE_PREFIX /scenegraph/graph
NO_RESOURCE_TARGET_PATH
)
install(TARGETS graph
@ -58,10 +58,3 @@ install(TARGETS graph
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(graph PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI Graph
)
qt6_qml_type_registration(graph)

View File

@ -27,6 +27,9 @@ qt_add_executable(metaltextureimport
set_target_properties(metaltextureimport PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME metaltextureimportapp
)
target_link_libraries(metaltextureimport PUBLIC
"-framework Metal"
@ -36,36 +39,26 @@ target_link_libraries(metaltextureimport PUBLIC
Qt::Quick
)
# Resources:
set(metaltextureimport_resource_files
"main.qml"
"squircle.frag"
"squircle.vert"
)
qt6_add_resources(metaltextureimport "metaltextureimport"
PREFIX
"/scenegraph/metaltextureimport"
FILES
${metaltextureimport_resource_files}
)
if(MACOS)
target_link_libraries(metaltextureimport PUBLIC
"-framework AppKit"
)
endif()
qt_add_qml_module(metaltextureimport
URI MetalTextureImport
VERSION 1.0
QML_FILES
main.qml
RESOURCES
squircle.frag
squircle.vert
RESOURCE_PREFIX /scenegraph/metaltextureimport
NO_RESOURCE_TARGET_PATH
)
install(TARGETS metaltextureimport
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(metaltextureimport PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI MetalTextureImport
)
qt6_qml_type_registration(metaltextureimport)

View File

@ -36,36 +36,26 @@ target_link_libraries(metalunderqml PUBLIC
Qt::Quick
)
# Resources:
set(metalunderqml_resource_files
"main.qml"
"squircle.frag"
"squircle.vert"
)
qt6_add_resources(metalunderqml "metalunderqml"
PREFIX
"/scenegraph/metalunderqml"
FILES
${metalunderqml_resource_files}
)
if(MACOS)
target_link_libraries(metalunderqml PUBLIC
"-framework AppKit"
)
endif()
qt_add_qml_module(metalunderqml
URI MetalUnderQML
VERSION 1.0
QML_FILES
main.qml
RESOURCES
squircle.frag
squircle.vert
RESOURCE_PREFIX /scenegraph/metalunderqml
NO_RESOURCE_TARGET_PATH
)
install(TARGETS metalunderqml
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(metalunderqml PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI MetalUnderQML
)
qt6_qml_type_registration(metalunderqml)

View File

@ -27,6 +27,9 @@ qt_add_executable(openglunderqml
set_target_properties(openglunderqml PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME openglunderqmlapp
)
target_link_libraries(openglunderqml PUBLIC
Qt::Core
@ -35,17 +38,12 @@ target_link_libraries(openglunderqml PUBLIC
Qt::Quick
)
# Resources:
set(openglunderqml_resource_files
"main.qml"
)
qt6_add_resources(openglunderqml "openglunderqml"
PREFIX
"/scenegraph/openglunderqml"
FILES
${openglunderqml_resource_files}
qt_add_qml_module(openglunderqml
URI OpenGLUnderQML
VERSION 1.0
QML_FILES main.qml
RESOURCE_PREFIX /scenegraph/openglunderqml
NO_RESOURCE_TARGET_PATH
)
install(TARGETS openglunderqml
@ -53,10 +51,3 @@ install(TARGETS openglunderqml
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(openglunderqml PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI OpenGLUnderQML
)
qt6_qml_type_registration(openglunderqml)

View File

@ -35,18 +35,13 @@ target_link_libraries(threadedanimation PUBLIC
Qt::Quick
)
# Resources:
set(threadedanimation_resource_files
"main.qml"
"spinner.png"
)
qt6_add_resources(threadedanimation "threadedanimation"
PREFIX
"/scenegraph/threadedanimation"
FILES
${threadedanimation_resource_files}
qt_add_qml_module(threadedanimation
URI Spinner
VERSION 1.0
QML_FILES main.qml
RESOURCES spinner.png
RESOURCE_PREFIX /scenegraph/threadedanimation
NO_RESOURCE_TARGET_PATH
)
install(TARGETS threadedanimation
@ -54,10 +49,3 @@ install(TARGETS threadedanimation
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(threadedanimation PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI Spinner
)
qt6_qml_type_registration(threadedanimation)

View File

@ -35,20 +35,17 @@ target_link_libraries(twotextureproviders PUBLIC
Qt::Quick
)
# Resources:
set(twotextureproviders_resource_files
"main.qml"
"shaders/checker.frag.qsb"
"shaders/xorblender.frag.qsb"
"shaders/xorblender.vert.qsb"
)
qt6_add_resources(twotextureproviders "twotextureproviders"
PREFIX
"/scenegraph/twotextureproviders"
FILES
${twotextureproviders_resource_files}
qt_add_qml_module(twotextureproviders
URI SceneGraphRendering
VERSION 1.0
QML_FILES
main.qml
RESOURCES
shaders/checker.frag.qsb
shaders/xorblender.frag.qsb
shaders/xorblender.vert.qsb
RESOURCE_PREFIX /scenegraph/twotextureproviders
NO_RESOURCE_TARGET_PATH
)
install(TARGETS twotextureproviders
@ -56,10 +53,3 @@ install(TARGETS twotextureproviders
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(twotextureproviders PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI SceneGraphRendering
)
qt6_qml_type_registration(twotextureproviders)

View File

@ -27,6 +27,9 @@ qt_add_executable(vulkantextureimport
set_target_properties(vulkantextureimport PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME vulkantextureimportapp
)
target_link_libraries(vulkantextureimport PUBLIC
Qt::Core
@ -35,19 +38,16 @@ target_link_libraries(vulkantextureimport PUBLIC
Qt::Quick
)
# Resources:
set(vulkantextureimport_resource_files
"main.qml"
"squircle.frag.spv"
"squircle.vert.spv"
)
qt6_add_resources(vulkantextureimport "vulkantextureimport"
PREFIX
"/scenegraph/vulkantextureimport"
FILES
${vulkantextureimport_resource_files}
qt_add_qml_module(vulkantextureimport
URI VulkanTextureImport
VERSION 1.0
QML_FILES
main.qml
RESOURCES
squircle.frag.spv
squircle.vert.spv
RESOURCE_PREFIX /scenegraph/vulkantextureimport
NO_RESOURCE_TARGET_PATH
)
install(TARGETS vulkantextureimport
@ -55,10 +55,3 @@ install(TARGETS vulkantextureimport
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(vulkantextureimport PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI VulkanTextureImport
)
qt6_qml_type_registration(vulkantextureimport)

View File

@ -27,6 +27,9 @@ qt_add_executable(vulkanunderqml
set_target_properties(vulkanunderqml PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME vulkanunderqmlapp
)
target_link_libraries(vulkanunderqml PUBLIC
Qt::Core
@ -35,19 +38,16 @@ target_link_libraries(vulkanunderqml PUBLIC
Qt::Quick
)
# Resources:
set(vulkanunderqml_resource_files
"main.qml"
"squircle.frag.spv"
"squircle.vert.spv"
)
qt6_add_resources(vulkanunderqml "vulkanunderqml"
PREFIX
"/scenegraph/vulkanunderqml"
FILES
${vulkanunderqml_resource_files}
qt_add_qml_module(vulkanunderqml
URI VulkanUnderQML
VERSION 1.0
QML_FILES
main.qml
RESOURCES
squircle.frag.spv
squircle.vert.spv
RESOURCE_PREFIX /scenegraph/vulkanunderqml
NO_RESOURCE_TARGET_PATH
)
install(TARGETS vulkanunderqml
@ -55,10 +55,3 @@ install(TARGETS vulkanunderqml
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
set_target_properties(vulkanunderqml PROPERTIES
QT_QML_MODULE_VERSION 1.0
QT_QML_MODULE_URI VulkanUnderQML
)
qt6_qml_type_registration(vulkanunderqml)

View File

@ -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)

View File

@ -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)