diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-08-31 12:43:05 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-09-01 11:49:06 +0200 |
commit | 66c011c5582de0565d85a77b282118a84aba51ad (patch) | |
tree | 163f918543dcbcd57ee3e7d2a9de1406c5951861 /examples/quick/shapes | |
parent | 31a36fc39245b460489d03bac3d89d240a1e6575 (diff) |
Clean up shapes example
Drop the confusing alias mangling on all the QML files. Instead move
them into the base "shapes" directory. Also, use a QML module in CMake
and use the "shared" module as intended.
Pick-to: 6.2
Change-Id: I6a8fc3f2b2f86f58a54e188cf83ec7e2d4e8f468
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples/quick/shapes')
-rw-r--r-- | examples/quick/shapes/CMakeLists.txt | 164 | ||||
-rw-r--r-- | examples/quick/shapes/clippedtigers.qml (renamed from examples/quick/shapes/content/clippedtigers.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/interactive.qml (renamed from examples/quick/shapes/content/interactive.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item10.qml (renamed from examples/quick/shapes/content/item10.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item11.qml (renamed from examples/quick/shapes/content/item11.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item12.qml (renamed from examples/quick/shapes/content/item12.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item13.qml (renamed from examples/quick/shapes/content/item13.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item14.qml (renamed from examples/quick/shapes/content/item14.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item15.qml (renamed from examples/quick/shapes/content/item15.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item17.qml (renamed from examples/quick/shapes/content/item17.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item18.qml (renamed from examples/quick/shapes/content/item18.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item2.qml (renamed from examples/quick/shapes/content/item2.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item3.qml (renamed from examples/quick/shapes/content/item3.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item4.qml (renamed from examples/quick/shapes/content/item4.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item5.qml (renamed from examples/quick/shapes/content/item5.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item6.qml (renamed from examples/quick/shapes/content/item6.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item7.qml (renamed from examples/quick/shapes/content/item7.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item8.qml (renamed from examples/quick/shapes/content/item8.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/item9.qml (renamed from examples/quick/shapes/content/item9.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/main.qml (renamed from examples/quick/shapes/content/main.qml) | 1 | ||||
-rw-r--r-- | examples/quick/shapes/sampling.qml (renamed from examples/quick/shapes/content/sampling.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/shapegallery.qml (renamed from examples/quick/shapes/content/shapegallery.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/shapes.pro | 27 | ||||
-rw-r--r-- | examples/quick/shapes/shapes.qrc | 51 | ||||
-rw-r--r-- | examples/quick/shapes/tapableTriangle.qml (renamed from examples/quick/shapes/content/tapableTriangle.qml) | 0 | ||||
-rw-r--r-- | examples/quick/shapes/tiger.qml (renamed from examples/quick/shapes/content/tiger.qml) | 0 |
26 files changed, 61 insertions, 182 deletions
diff --git a/examples/quick/shapes/CMakeLists.txt b/examples/quick/shapes/CMakeLists.txt index 9b91789f24..ef4a5449c6 100644 --- a/examples/quick/shapes/CMakeLists.txt +++ b/examples/quick/shapes/CMakeLists.txt @@ -20,149 +20,53 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Quick) find_package(Qt6 COMPONENTS Qml) -qt_add_executable(shapes +add_subdirectory("../shared" "shared") + +qt_add_executable(shapesexample main.cpp ) -set_target_properties(shapes PROPERTIES +set_target_properties(shapesexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(shapes PUBLIC +target_link_libraries(shapesexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick + shapes_shared ) - -# Resources: -set_source_files_properties("../shared/LauncherList.qml" - PROPERTIES QT_RESOURCE_ALIAS "LauncherList.qml" -) -set_source_files_properties("../shared/SimpleLauncherDelegate.qml" - PROPERTIES QT_RESOURCE_ALIAS "SimpleLauncherDelegate.qml" -) -set_source_files_properties("../shared/Slider.qml" - PROPERTIES QT_RESOURCE_ALIAS "Slider.qml" -) -set_source_files_properties("../shared/images/back.png" - PROPERTIES QT_RESOURCE_ALIAS "images/back.png" -) -set_source_files_properties("../shared/images/next.png" - PROPERTIES QT_RESOURCE_ALIAS "images/next.png" -) -set_source_files_properties("../shared/images/slider_handle.png" - PROPERTIES QT_RESOURCE_ALIAS "images/slider_handle.png" -) -set_source_files_properties("content/clippedtigers.qml" - PROPERTIES QT_RESOURCE_ALIAS "clippedtigers.qml" -) -set_source_files_properties("content/interactive.qml" - PROPERTIES QT_RESOURCE_ALIAS "interactive.qml" -) -set_source_files_properties("content/item10.qml" - PROPERTIES QT_RESOURCE_ALIAS "item10.qml" -) -set_source_files_properties("content/item11.qml" - PROPERTIES QT_RESOURCE_ALIAS "item11.qml" -) -set_source_files_properties("content/item12.qml" - PROPERTIES QT_RESOURCE_ALIAS "item12.qml" -) -set_source_files_properties("content/item13.qml" - PROPERTIES QT_RESOURCE_ALIAS "item13.qml" -) -set_source_files_properties("content/item14.qml" - PROPERTIES QT_RESOURCE_ALIAS "item14.qml" -) -set_source_files_properties("content/item15.qml" - PROPERTIES QT_RESOURCE_ALIAS "item15.qml" -) -set_source_files_properties("content/item17.qml" - PROPERTIES QT_RESOURCE_ALIAS "item17.qml" -) -set_source_files_properties("content/item18.qml" - PROPERTIES QT_RESOURCE_ALIAS "item18.qml" -) -set_source_files_properties("content/item2.qml" - PROPERTIES QT_RESOURCE_ALIAS "item2.qml" -) -set_source_files_properties("content/item3.qml" - PROPERTIES QT_RESOURCE_ALIAS "item3.qml" -) -set_source_files_properties("content/item4.qml" - PROPERTIES QT_RESOURCE_ALIAS "item4.qml" -) -set_source_files_properties("content/item5.qml" - PROPERTIES QT_RESOURCE_ALIAS "item5.qml" -) -set_source_files_properties("content/item6.qml" - PROPERTIES QT_RESOURCE_ALIAS "item6.qml" -) -set_source_files_properties("content/item7.qml" - PROPERTIES QT_RESOURCE_ALIAS "item7.qml" -) -set_source_files_properties("content/item8.qml" - PROPERTIES QT_RESOURCE_ALIAS "item8.qml" -) -set_source_files_properties("content/item9.qml" - PROPERTIES QT_RESOURCE_ALIAS "item9.qml" -) -set_source_files_properties("content/main.qml" - PROPERTIES QT_RESOURCE_ALIAS "main.qml" -) -set_source_files_properties("content/sampling.qml" - PROPERTIES QT_RESOURCE_ALIAS "sampling.qml" -) -set_source_files_properties("content/shapegallery.qml" - PROPERTIES QT_RESOURCE_ALIAS "shapegallery.qml" -) -set_source_files_properties("content/tapableTriangle.qml" - PROPERTIES QT_RESOURCE_ALIAS "tapableTriangle.qml" -) -set_source_files_properties("content/tiger.qml" - PROPERTIES QT_RESOURCE_ALIAS "tiger.qml" -) -set(shapes_resource_files - "../shared/LauncherList.qml" - "../shared/SimpleLauncherDelegate.qml" - "../shared/Slider.qml" - "../shared/images/back.png" - "../shared/images/next.png" - "../shared/images/slider_handle.png" - "content/clippedtigers.qml" - "content/interactive.qml" - "content/item10.qml" - "content/item11.qml" - "content/item12.qml" - "content/item13.qml" - "content/item14.qml" - "content/item15.qml" - "content/item17.qml" - "content/item18.qml" - "content/item2.qml" - "content/item3.qml" - "content/item4.qml" - "content/item5.qml" - "content/item6.qml" - "content/item7.qml" - "content/item8.qml" - "content/item9.qml" - "content/main.qml" - "content/sampling.qml" - "content/shapegallery.qml" - "content/tapableTriangle.qml" - "content/tiger.qml" -) - -qt6_add_resources(shapes "shapes" - PREFIX - "/shapes" - FILES - ${shapes_resource_files} +qt_add_qml_module(shapesexample + URI shapes + VERSION 1.0 + QML_FILES + "clippedtigers.qml" + "interactive.qml" + "item10.qml" + "item11.qml" + "item12.qml" + "item13.qml" + "item14.qml" + "item15.qml" + "item17.qml" + "item18.qml" + "item2.qml" + "item3.qml" + "item4.qml" + "item5.qml" + "item6.qml" + "item7.qml" + "item8.qml" + "item9.qml" + "main.qml" + "sampling.qml" + "shapegallery.qml" + "tapableTriangle.qml" + "tiger.qml" ) -install(TARGETS shapes +install(TARGETS shapesexample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/quick/shapes/content/clippedtigers.qml b/examples/quick/shapes/clippedtigers.qml index 845eb959c1..845eb959c1 100644 --- a/examples/quick/shapes/content/clippedtigers.qml +++ b/examples/quick/shapes/clippedtigers.qml diff --git a/examples/quick/shapes/content/interactive.qml b/examples/quick/shapes/interactive.qml index 015149c51d..015149c51d 100644 --- a/examples/quick/shapes/content/interactive.qml +++ b/examples/quick/shapes/interactive.qml diff --git a/examples/quick/shapes/content/item10.qml b/examples/quick/shapes/item10.qml index 38ecb302ba..38ecb302ba 100644 --- a/examples/quick/shapes/content/item10.qml +++ b/examples/quick/shapes/item10.qml diff --git a/examples/quick/shapes/content/item11.qml b/examples/quick/shapes/item11.qml index 09cc2c8211..09cc2c8211 100644 --- a/examples/quick/shapes/content/item11.qml +++ b/examples/quick/shapes/item11.qml diff --git a/examples/quick/shapes/content/item12.qml b/examples/quick/shapes/item12.qml index 6e39a90f55..6e39a90f55 100644 --- a/examples/quick/shapes/content/item12.qml +++ b/examples/quick/shapes/item12.qml diff --git a/examples/quick/shapes/content/item13.qml b/examples/quick/shapes/item13.qml index 2c0fdfa623..2c0fdfa623 100644 --- a/examples/quick/shapes/content/item13.qml +++ b/examples/quick/shapes/item13.qml diff --git a/examples/quick/shapes/content/item14.qml b/examples/quick/shapes/item14.qml index b7fa8fa6ab..b7fa8fa6ab 100644 --- a/examples/quick/shapes/content/item14.qml +++ b/examples/quick/shapes/item14.qml diff --git a/examples/quick/shapes/content/item15.qml b/examples/quick/shapes/item15.qml index 3530e5e0fb..3530e5e0fb 100644 --- a/examples/quick/shapes/content/item15.qml +++ b/examples/quick/shapes/item15.qml diff --git a/examples/quick/shapes/content/item17.qml b/examples/quick/shapes/item17.qml index 366d8e329b..366d8e329b 100644 --- a/examples/quick/shapes/content/item17.qml +++ b/examples/quick/shapes/item17.qml diff --git a/examples/quick/shapes/content/item18.qml b/examples/quick/shapes/item18.qml index c61b070405..c61b070405 100644 --- a/examples/quick/shapes/content/item18.qml +++ b/examples/quick/shapes/item18.qml diff --git a/examples/quick/shapes/content/item2.qml b/examples/quick/shapes/item2.qml index 47841f1a68..47841f1a68 100644 --- a/examples/quick/shapes/content/item2.qml +++ b/examples/quick/shapes/item2.qml diff --git a/examples/quick/shapes/content/item3.qml b/examples/quick/shapes/item3.qml index bcf6c40c3c..bcf6c40c3c 100644 --- a/examples/quick/shapes/content/item3.qml +++ b/examples/quick/shapes/item3.qml diff --git a/examples/quick/shapes/content/item4.qml b/examples/quick/shapes/item4.qml index 426fb144c2..426fb144c2 100644 --- a/examples/quick/shapes/content/item4.qml +++ b/examples/quick/shapes/item4.qml diff --git a/examples/quick/shapes/content/item5.qml b/examples/quick/shapes/item5.qml index 0eb9a4631e..0eb9a4631e 100644 --- a/examples/quick/shapes/content/item5.qml +++ b/examples/quick/shapes/item5.qml diff --git a/examples/quick/shapes/content/item6.qml b/examples/quick/shapes/item6.qml index 6300ced608..6300ced608 100644 --- a/examples/quick/shapes/content/item6.qml +++ b/examples/quick/shapes/item6.qml diff --git a/examples/quick/shapes/content/item7.qml b/examples/quick/shapes/item7.qml index ed34c1de77..ed34c1de77 100644 --- a/examples/quick/shapes/content/item7.qml +++ b/examples/quick/shapes/item7.qml diff --git a/examples/quick/shapes/content/item8.qml b/examples/quick/shapes/item8.qml index cc06a48501..cc06a48501 100644 --- a/examples/quick/shapes/content/item8.qml +++ b/examples/quick/shapes/item8.qml diff --git a/examples/quick/shapes/content/item9.qml b/examples/quick/shapes/item9.qml index c4ef8ccf79..c4ef8ccf79 100644 --- a/examples/quick/shapes/content/item9.qml +++ b/examples/quick/shapes/item9.qml diff --git a/examples/quick/shapes/content/main.qml b/examples/quick/shapes/main.qml index b5ed88cc52..1ddb9d0784 100644 --- a/examples/quick/shapes/content/main.qml +++ b/examples/quick/shapes/main.qml @@ -49,6 +49,7 @@ ****************************************************************************/ import QtQuick +import shared Item { width: 1280 diff --git a/examples/quick/shapes/content/sampling.qml b/examples/quick/shapes/sampling.qml index ca45a3ab7c..ca45a3ab7c 100644 --- a/examples/quick/shapes/content/sampling.qml +++ b/examples/quick/shapes/sampling.qml diff --git a/examples/quick/shapes/content/shapegallery.qml b/examples/quick/shapes/shapegallery.qml index 6870ea1465..6870ea1465 100644 --- a/examples/quick/shapes/content/shapegallery.qml +++ b/examples/quick/shapes/shapegallery.qml diff --git a/examples/quick/shapes/shapes.pro b/examples/quick/shapes/shapes.pro index f99d941804..eb2baae0b4 100644 --- a/examples/quick/shapes/shapes.pro +++ b/examples/quick/shapes/shapes.pro @@ -2,30 +2,9 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp -RESOURCES += shapes.qrc -OTHER_FILES += content/main.qml \ - content/shapegallery.qml \ - content/interactive.qml \ - content/sampling.qml \ - content/clippedtigers.qml \ - content/tiger.qml \ - content/tapableTriangle.qml \ - content/item2.qml \ - content/item3.qml \ - content/item4.qml \ - content/item5.qml \ - content/item6.qml \ - content/item7.qml \ - content/item8.qml \ - content/item9.qml \ - content/item10.qml \ - content/item11.qml \ - content/item12.qml \ - content/item13.qml \ - content/item14.qml \ - content/item15.qml \ - content/item17.qml \ - content/item18.qml +RESOURCES += \ + shapes.qrc \ + ../shared/shared.qrc target.path = $$[QT_INSTALL_EXAMPLES]/quick/shapes INSTALLS += target diff --git a/examples/quick/shapes/shapes.qrc b/examples/quick/shapes/shapes.qrc index ca8024e6af..84f4e8a1dc 100644 --- a/examples/quick/shapes/shapes.qrc +++ b/examples/quick/shapes/shapes.qrc @@ -1,32 +1,27 @@ <RCC> <qresource prefix="/shapes"> - <file alias="LauncherList.qml">../shared/LauncherList.qml</file> - <file alias="SimpleLauncherDelegate.qml">../shared/SimpleLauncherDelegate.qml</file> - <file alias="images/next.png">../shared/images/next.png</file> - <file alias="images/back.png">../shared/images/back.png</file> - <file alias="images/slider_handle.png">../shared/images/slider_handle.png</file> - <file alias="main.qml">content/main.qml</file> - <file alias="shapegallery.qml">content/shapegallery.qml</file> - <file alias="interactive.qml">content/interactive.qml</file> - <file alias="sampling.qml">content/sampling.qml</file> - <file alias="clippedtigers.qml">content/clippedtigers.qml</file> - <file alias="tiger.qml">content/tiger.qml</file> - <file alias="tapableTriangle.qml">content/tapableTriangle.qml</file> - <file alias="item2.qml">content/item2.qml</file> - <file alias="item3.qml">content/item3.qml</file> - <file alias="item4.qml">content/item4.qml</file> - <file alias="item5.qml">content/item5.qml</file> - <file alias="item6.qml">content/item6.qml</file> - <file alias="item7.qml">content/item7.qml</file> - <file alias="item8.qml">content/item8.qml</file> - <file alias="item9.qml">content/item9.qml</file> - <file alias="item10.qml">content/item10.qml</file> - <file alias="item11.qml">content/item11.qml</file> - <file alias="item12.qml">content/item12.qml</file> - <file alias="item13.qml">content/item13.qml</file> - <file alias="item14.qml">content/item14.qml</file> - <file alias="item15.qml">content/item15.qml</file> - <file alias="item17.qml">content/item17.qml</file> - <file alias="item18.qml">content/item18.qml</file> + <file>main.qml</file> + <file>shapegallery.qml</file> + <file>interactive.qml</file> + <file>sampling.qml</file> + <file>clippedtigers.qml</file> + <file>tiger.qml</file> + <file>tapableTriangle.qml</file> + <file>item2.qml</file> + <file>item3.qml</file> + <file>item4.qml</file> + <file>item5.qml</file> + <file>item6.qml</file> + <file>item7.qml</file> + <file>item8.qml</file> + <file>item9.qml</file> + <file>item10.qml</file> + <file>item11.qml</file> + <file>item12.qml</file> + <file>item13.qml</file> + <file>item14.qml</file> + <file>item15.qml</file> + <file>item17.qml</file> + <file>item18.qml</file> </qresource> </RCC> diff --git a/examples/quick/shapes/content/tapableTriangle.qml b/examples/quick/shapes/tapableTriangle.qml index cc33bae9a0..cc33bae9a0 100644 --- a/examples/quick/shapes/content/tapableTriangle.qml +++ b/examples/quick/shapes/tapableTriangle.qml diff --git a/examples/quick/shapes/content/tiger.qml b/examples/quick/shapes/tiger.qml index 0bdef97675..0bdef97675 100644 --- a/examples/quick/shapes/content/tiger.qml +++ b/examples/quick/shapes/tiger.qml |