diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-08-31 13:32:26 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-01 14:13:08 +0000 |
commit | 4159792b8e646580cf45fe72902b356c23acd9e0 (patch) | |
tree | 9eac23df262ac3c20b96096912fb6fa0ec5bdbcb /examples/quick | |
parent | 60c20fa5d7b6d5daea1a5d07ec3c7af4fd81ac51 (diff) |
Fix dialcontrol example to use a QML module
Also move the QML files out of the "content" subdirectory in order to
avoid the directory import.
Change-Id: I84a1f5ef1a45e5098ec3213c6fbce06346f3606a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2dfb912058ecb865f2ed5becad04756b51bfbc7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick')
-rw-r--r-- | examples/quick/customitems/dialcontrol/CMakeLists.txt | 39 | ||||
-rw-r--r-- | examples/quick/customitems/dialcontrol/Dial.qml (renamed from examples/quick/customitems/dialcontrol/content/Dial.qml) | 0 | ||||
-rw-r--r-- | examples/quick/customitems/dialcontrol/QuitButton.qml (renamed from examples/quick/customitems/dialcontrol/content/QuitButton.qml) | 0 | ||||
-rw-r--r-- | examples/quick/customitems/dialcontrol/background.png (renamed from examples/quick/customitems/dialcontrol/content/background.png) | bin | 35876 -> 35876 bytes | |||
-rw-r--r-- | examples/quick/customitems/dialcontrol/dialcontrol.qml | 1 | ||||
-rw-r--r-- | examples/quick/customitems/dialcontrol/dialcontrol.qrc | 16 | ||||
-rw-r--r-- | examples/quick/customitems/dialcontrol/main.cpp | 2 | ||||
-rw-r--r-- | examples/quick/customitems/dialcontrol/needle.png (renamed from examples/quick/customitems/dialcontrol/content/needle.png) | bin | 342 -> 342 bytes | |||
-rw-r--r-- | examples/quick/customitems/dialcontrol/needle_shadow.png (renamed from examples/quick/customitems/dialcontrol/content/needle_shadow.png) | bin | 632 -> 632 bytes | |||
-rw-r--r-- | examples/quick/customitems/dialcontrol/overlay.png (renamed from examples/quick/customitems/dialcontrol/content/overlay.png) | bin | 3564 -> 3564 bytes | |||
-rw-r--r-- | examples/quick/customitems/dialcontrol/quit.png (renamed from examples/quick/customitems/dialcontrol/content/quit.png) | bin | 583 -> 583 bytes |
11 files changed, 26 insertions, 32 deletions
diff --git a/examples/quick/customitems/dialcontrol/CMakeLists.txt b/examples/quick/customitems/dialcontrol/CMakeLists.txt index 4c859f1082..dfc69c3c67 100644 --- a/examples/quick/customitems/dialcontrol/CMakeLists.txt +++ b/examples/quick/customitems/dialcontrol/CMakeLists.txt @@ -20,41 +20,36 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Quick) find_package(Qt6 COMPONENTS Qml) -qt_add_executable(dialcontrol +qt_add_executable(dialcontrolexample main.cpp ) -set_target_properties(dialcontrol PROPERTIES +set_target_properties(dialcontrolexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(dialcontrol PUBLIC +target_link_libraries(dialcontrolexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick ) - -# Resources: -set(dialcontrol_resource_files - "content/Dial.qml" - "content/QuitButton.qml" - "content/background.png" - "content/needle.png" - "content/needle_shadow.png" - "content/overlay.png" - "content/quit.png" - "dialcontrol.qml" -) - -qt6_add_resources(dialcontrol "dialcontrol" - PREFIX - "/" - FILES - ${dialcontrol_resource_files} +qt_add_qml_module(dialcontrolexample + URI dialcontrol + VERSION 1.0 + QML_FILES + "Dial.qml" + "QuitButton.qml" + "dialcontrol.qml" + RESOURCES + "background.png" + "needle.png" + "needle_shadow.png" + "overlay.png" + "quit.png" ) -install(TARGETS dialcontrol +install(TARGETS dialcontrolexample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/quick/customitems/dialcontrol/content/Dial.qml b/examples/quick/customitems/dialcontrol/Dial.qml index 108b0e7410..108b0e7410 100644 --- a/examples/quick/customitems/dialcontrol/content/Dial.qml +++ b/examples/quick/customitems/dialcontrol/Dial.qml diff --git a/examples/quick/customitems/dialcontrol/content/QuitButton.qml b/examples/quick/customitems/dialcontrol/QuitButton.qml index 87dc159c5d..87dc159c5d 100644 --- a/examples/quick/customitems/dialcontrol/content/QuitButton.qml +++ b/examples/quick/customitems/dialcontrol/QuitButton.qml diff --git a/examples/quick/customitems/dialcontrol/content/background.png b/examples/quick/customitems/dialcontrol/background.png Binary files differindex 75d555d7ab..75d555d7ab 100644 --- a/examples/quick/customitems/dialcontrol/content/background.png +++ b/examples/quick/customitems/dialcontrol/background.png diff --git a/examples/quick/customitems/dialcontrol/dialcontrol.qml b/examples/quick/customitems/dialcontrol/dialcontrol.qml index d0a623a72a..c6bff8f2c0 100644 --- a/examples/quick/customitems/dialcontrol/dialcontrol.qml +++ b/examples/quick/customitems/dialcontrol/dialcontrol.qml @@ -51,7 +51,6 @@ //! [imports] import QtQuick 2.2 import QtQuick.Window 2.1 -import "content" //! [imports] //! [0] diff --git a/examples/quick/customitems/dialcontrol/dialcontrol.qrc b/examples/quick/customitems/dialcontrol/dialcontrol.qrc index 6433d68bb8..9b9bd42f23 100644 --- a/examples/quick/customitems/dialcontrol/dialcontrol.qrc +++ b/examples/quick/customitems/dialcontrol/dialcontrol.qrc @@ -1,12 +1,12 @@ <RCC> - <qresource prefix="/"> + <qresource prefix="/dialcontrol"> + <file>Dial.qml</file> + <file>QuitButton.qml</file> + <file>background.png</file> <file>dialcontrol.qml</file> - <file>content/background.png</file> - <file>content/Dial.qml</file> - <file>content/needle_shadow.png</file> - <file>content/needle.png</file> - <file>content/overlay.png</file> - <file>content/quit.png</file> - <file>content/QuitButton.qml</file> + <file>needle.png</file> + <file>needle_shadow.png</file> + <file>overlay.png</file> + <file>quit.png</file> </qresource> </RCC> diff --git a/examples/quick/customitems/dialcontrol/main.cpp b/examples/quick/customitems/dialcontrol/main.cpp index 6ebe203a70..3b925c3d8b 100644 --- a/examples/quick/customitems/dialcontrol/main.cpp +++ b/examples/quick/customitems/dialcontrol/main.cpp @@ -48,4 +48,4 @@ ** ****************************************************************************/ #include "../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(dialcontrol) +DECLARATIVE_EXAMPLE_MAIN(dialcontrol/dialcontrol) diff --git a/examples/quick/customitems/dialcontrol/content/needle.png b/examples/quick/customitems/dialcontrol/needle.png Binary files differindex 2d19f75039..2d19f75039 100644 --- a/examples/quick/customitems/dialcontrol/content/needle.png +++ b/examples/quick/customitems/dialcontrol/needle.png diff --git a/examples/quick/customitems/dialcontrol/content/needle_shadow.png b/examples/quick/customitems/dialcontrol/needle_shadow.png Binary files differindex 8d8a928cc5..8d8a928cc5 100644 --- a/examples/quick/customitems/dialcontrol/content/needle_shadow.png +++ b/examples/quick/customitems/dialcontrol/needle_shadow.png diff --git a/examples/quick/customitems/dialcontrol/content/overlay.png b/examples/quick/customitems/dialcontrol/overlay.png Binary files differindex 3860a7b590..3860a7b590 100644 --- a/examples/quick/customitems/dialcontrol/content/overlay.png +++ b/examples/quick/customitems/dialcontrol/overlay.png diff --git a/examples/quick/customitems/dialcontrol/content/quit.png b/examples/quick/customitems/dialcontrol/quit.png Binary files differindex b822057d4e..b822057d4e 100644 --- a/examples/quick/customitems/dialcontrol/content/quit.png +++ b/examples/quick/customitems/dialcontrol/quit.png |