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 Qt::Quick
) )
qt_add_qml_module(maskedmousearea
# Resources: URI Example
set(maskedmousearea_resource_files VERSION 1.0
"images/cloud_1.png" QML_FILES
"images/cloud_2.png" maskedmousearea.qml
"images/moon.png" RESOURCES
"maskedmousearea.qml" images/cloud_1.png
) images/cloud_2.png
images/moon.png
qt6_add_resources(maskedmousearea "maskedmousearea" RESOURCE_PREFIX /customitems/maskedmousearea
PREFIX NO_RESOURCE_TARGET_PATH
"/customitems/maskedmousearea"
FILES
${maskedmousearea_resource_files}
) )
install(TARGETS maskedmousearea install(TARGETS maskedmousearea
@ -56,10 +53,3 @@ install(TARGETS maskedmousearea
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Widgets
) )
qt_add_qml_module(qquickviewcomparison
# Resources: URI fbitem
set(qquickviewcomparison_resource_files VERSION 1.0
"test.qml" 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 install(TARGETS qquickviewcomparison
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Widgets
) )
qt_add_qml_module(quickwidget
# Resources: URI QuickWidgetExample
set(quickwidget_resource_files VERSION 1.0
"customgl.qml" QML_FILES
"rotatingsquare.qml" customgl.qml
"rotatingsquaretab.qml" rotatingsquare.qml
) rotatingsquaretab.qml
RESOURCE_PREFIX /quickwidget
qt6_add_resources(quickwidget "quickwidget" NO_RESOURCE_TARGET_PATH
PREFIX
"/quickwidget"
FILES
${quickwidget_resource_files}
) )
install(TARGETS quickwidget install(TARGETS quickwidget
@ -57,10 +53,3 @@ install(TARGETS quickwidget
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(customgeometry_declarative
# Resources: URI CustomGeometry
set(customgeometry_resource_files VERSION 1.0
"main.qml" QML_FILES main.qml
) RESOURCE_PREFIX /scenegraph/customgeometry
NO_RESOURCE_TARGET_PATH
qt6_add_resources(customgeometry_declarative "customgeometry" # special case
PREFIX
"/scenegraph/customgeometry"
FILES
${customgeometry_resource_files}
) )
install(TARGETS customgeometry_declarative # special case install(TARGETS customgeometry_declarative # special case
@ -51,10 +46,3 @@ install(TARGETS customgeometry_declarative # special case
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(custommaterial_declarative
# Resources: URI ExampleCustomMaterial
set(custommaterial_resource_files VERSION 1.0
"main.qml" QML_FILES
"shaders/mandelbrot.frag.qsb" main.qml
"shaders/mandelbrot.vert.qsb" RESOURCES
) shaders/mandelbrot.frag.qsb
shaders/mandelbrot.vert.qsb
qt6_add_resources(custommaterial_declarative "custommaterial" # special case RESOURCE_PREFIX /scenegraph/custommaterial
PREFIX NO_RESOURCE_TARGET_PATH
"/scenegraph/custommaterial"
FILES
${custommaterial_resource_files}
) )
install(TARGETS custommaterial_declarative # special case install(TARGETS custommaterial_declarative # special case
@ -55,10 +52,3 @@ install(TARGETS custommaterial_declarative # special case
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 d3dcompiler
) )
qt_add_qml_module(d3d11underqml
# Resources: URI D3D11UnderQML
set(d3d11underqml_resource_files VERSION 1.0
"main.qml" QML_FILES
"squircle.frag" main.qml
"squircle.vert" RESOURCES
) squircle.frag
squircle.vert
qt6_add_resources(d3d11underqml "d3d11underqml" RESOURCE_PREFIX /scenegraph/d3d11underqml
PREFIX NO_RESOURCE_TARGET_PATH
"/scenegraph/d3d11underqml"
FILES
${d3d11underqml_resource_files}
) )
install(TARGETS d3d11underqml install(TARGETS d3d11underqml
@ -57,10 +54,3 @@ install(TARGETS d3d11underqml
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(fboitem
# Resources: URI SceneGraphRendering
set(fboitem_resource_files VERSION 1.0
"main.qml" QML_FILES main.qml
"shaders/checker.frag.qsb" RESOURCES shaders/checker.frag.qsb
) RESOURCE_PREFIX /scenegraph/fboitem
NO_RESOURCE_TARGET_PATH
qt6_add_resources(fboitem "fboitem"
PREFIX
"/scenegraph/fboitem"
FILES
${fboitem_resource_files}
) )
install(TARGETS fboitem install(TARGETS fboitem
@ -59,10 +54,3 @@ install(TARGETS fboitem
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 set_target_properties(graph PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME graphapp
) )
target_link_libraries(graph PUBLIC target_link_libraries(graph PUBLIC
Qt::Core Qt::Core
@ -36,21 +39,18 @@ target_link_libraries(graph PUBLIC
Qt::Quick Qt::Quick
) )
qt_add_qml_module(graph
# Resources: URI Graph
set(graph_resource_files VERSION 1.0
"main.qml" QML_FILES
"shaders/line.frag.qsb" main.qml
"shaders/line.vert.qsb" RESOURCES
"shaders/noisy.frag.qsb" shaders/line.frag.qsb
"shaders/noisy.vert.qsb" shaders/line.vert.qsb
) shaders/noisy.frag.qsb
shaders/noisy.vert.qsb
qt6_add_resources(graph "graph" RESOURCE_PREFIX /scenegraph/graph
PREFIX NO_RESOURCE_TARGET_PATH
"/scenegraph/graph"
FILES
${graph_resource_files}
) )
install(TARGETS graph install(TARGETS graph
@ -58,10 +58,3 @@ install(TARGETS graph
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 set_target_properties(metaltextureimport PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME metaltextureimportapp
) )
target_link_libraries(metaltextureimport PUBLIC target_link_libraries(metaltextureimport PUBLIC
"-framework Metal" "-framework Metal"
@ -36,36 +39,26 @@ target_link_libraries(metaltextureimport PUBLIC
Qt::Quick 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) if(MACOS)
target_link_libraries(metaltextureimport PUBLIC target_link_libraries(metaltextureimport PUBLIC
"-framework AppKit" "-framework AppKit"
) )
endif() 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 install(TARGETS metaltextureimport
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 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) if(MACOS)
target_link_libraries(metalunderqml PUBLIC target_link_libraries(metalunderqml PUBLIC
"-framework AppKit" "-framework AppKit"
) )
endif() 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 install(TARGETS metalunderqml
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 set_target_properties(openglunderqml PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME openglunderqmlapp
) )
target_link_libraries(openglunderqml PUBLIC target_link_libraries(openglunderqml PUBLIC
Qt::Core Qt::Core
@ -35,17 +38,12 @@ target_link_libraries(openglunderqml PUBLIC
Qt::Quick Qt::Quick
) )
qt_add_qml_module(openglunderqml
# Resources: URI OpenGLUnderQML
set(openglunderqml_resource_files VERSION 1.0
"main.qml" QML_FILES main.qml
) RESOURCE_PREFIX /scenegraph/openglunderqml
NO_RESOURCE_TARGET_PATH
qt6_add_resources(openglunderqml "openglunderqml"
PREFIX
"/scenegraph/openglunderqml"
FILES
${openglunderqml_resource_files}
) )
install(TARGETS openglunderqml install(TARGETS openglunderqml
@ -53,10 +51,3 @@ install(TARGETS openglunderqml
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(threadedanimation
# Resources: URI Spinner
set(threadedanimation_resource_files VERSION 1.0
"main.qml" QML_FILES main.qml
"spinner.png" RESOURCES spinner.png
) RESOURCE_PREFIX /scenegraph/threadedanimation
NO_RESOURCE_TARGET_PATH
qt6_add_resources(threadedanimation "threadedanimation"
PREFIX
"/scenegraph/threadedanimation"
FILES
${threadedanimation_resource_files}
) )
install(TARGETS threadedanimation install(TARGETS threadedanimation
@ -54,10 +49,3 @@ install(TARGETS threadedanimation
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(twotextureproviders
# Resources: URI SceneGraphRendering
set(twotextureproviders_resource_files VERSION 1.0
"main.qml" QML_FILES
"shaders/checker.frag.qsb" main.qml
"shaders/xorblender.frag.qsb" RESOURCES
"shaders/xorblender.vert.qsb" shaders/checker.frag.qsb
) shaders/xorblender.frag.qsb
shaders/xorblender.vert.qsb
qt6_add_resources(twotextureproviders "twotextureproviders" RESOURCE_PREFIX /scenegraph/twotextureproviders
PREFIX NO_RESOURCE_TARGET_PATH
"/scenegraph/twotextureproviders"
FILES
${twotextureproviders_resource_files}
) )
install(TARGETS twotextureproviders install(TARGETS twotextureproviders
@ -56,10 +53,3 @@ install(TARGETS twotextureproviders
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 set_target_properties(vulkantextureimport PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME vulkantextureimportapp
) )
target_link_libraries(vulkantextureimport PUBLIC target_link_libraries(vulkantextureimport PUBLIC
Qt::Core Qt::Core
@ -35,19 +38,16 @@ target_link_libraries(vulkantextureimport PUBLIC
Qt::Quick Qt::Quick
) )
qt_add_qml_module(vulkantextureimport
# Resources: URI VulkanTextureImport
set(vulkantextureimport_resource_files VERSION 1.0
"main.qml" QML_FILES
"squircle.frag.spv" main.qml
"squircle.vert.spv" RESOURCES
) squircle.frag.spv
squircle.vert.spv
qt6_add_resources(vulkantextureimport "vulkantextureimport" RESOURCE_PREFIX /scenegraph/vulkantextureimport
PREFIX NO_RESOURCE_TARGET_PATH
"/scenegraph/vulkantextureimport"
FILES
${vulkantextureimport_resource_files}
) )
install(TARGETS vulkantextureimport install(TARGETS vulkantextureimport
@ -55,10 +55,3 @@ install(TARGETS vulkantextureimport
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 set_target_properties(vulkanunderqml PROPERTIES
WIN32_EXECUTABLE TRUE WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
# Prevent name clash with build subdirectory on case-insensitive file systems
OUTPUT_NAME vulkanunderqmlapp
) )
target_link_libraries(vulkanunderqml PUBLIC target_link_libraries(vulkanunderqml PUBLIC
Qt::Core Qt::Core
@ -35,19 +38,16 @@ target_link_libraries(vulkanunderqml PUBLIC
Qt::Quick Qt::Quick
) )
qt_add_qml_module(vulkanunderqml
# Resources: URI VulkanUnderQML
set(vulkanunderqml_resource_files VERSION 1.0
"main.qml" QML_FILES
"squircle.frag.spv" main.qml
"squircle.vert.spv" RESOURCES
) squircle.frag.spv
squircle.vert.spv
qt6_add_resources(vulkanunderqml "vulkanunderqml" RESOURCE_PREFIX /scenegraph/vulkanunderqml
PREFIX NO_RESOURCE_TARGET_PATH
"/scenegraph/vulkanunderqml"
FILES
${vulkanunderqml_resource_files}
) )
install(TARGETS vulkanunderqml install(TARGETS vulkanunderqml
@ -55,10 +55,3 @@ install(TARGETS vulkanunderqml
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(gameoflife
# Resources: URI GameOfLifeModel
set(qmake_immediate_resource_files VERSION 1.0
"gosperglidergun.cells" QML_FILES main.qml
"main.qml" RESOURCES gosperglidergun.cells
) NO_RESOURCE_TARGET_PATH
qt6_add_resources(gameoflife "qmake_immediate"
PREFIX
"/"
FILES
${qmake_immediate_resource_files}
) )
install(TARGETS gameoflife install(TARGETS gameoflife
@ -54,10 +48,3 @@ install(TARGETS gameoflife
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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 Qt::Quick
) )
qt_add_qml_module(qml_pixelator
# Resources: URI ImageModel
set(qmake_immediate_resource_files VERSION 1.0
"main.qml" QML_FILES main.qml
"qt.png" RESOURCES qt.png
) NO_RESOURCE_TARGET_PATH
qt6_add_resources(qml_pixelator "qmake_immediate"
PREFIX
"/"
FILES
${qmake_immediate_resource_files}
) )
install(TARGETS qml_pixelator install(TARGETS qml_pixelator
@ -54,10 +48,3 @@ install(TARGETS qml_pixelator
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY 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)