diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-08-31 13:11:11 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-04 10:39:38 +0000 |
commit | b58969962c89b44097e4eeadfc7d9d14afc78ff9 (patch) | |
tree | 1f7b105fc974538abf8242b02380aeb7d13cdf0f | |
parent | a733875bce306c9d8897cce7fcc5e1d4080eb122 (diff) |
Fix animation example to use a QML module
Change-Id: Ic53194b43eb651438d3f89bbb5dfbb97aff8b606
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 65b2e46423120d139dde0741f1f8e7763c08ce92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/quick/animation/CMakeLists.txt | 93 | ||||
-rw-r--r-- | examples/quick/animation/animation.qml | 2 | ||||
-rw-r--r-- | examples/quick/animation/animation.qmlproject | 1 |
3 files changed, 35 insertions, 61 deletions
diff --git a/examples/quick/animation/CMakeLists.txt b/examples/quick/animation/CMakeLists.txt index 3b37b18734..2d565c24f9 100644 --- a/examples/quick/animation/CMakeLists.txt +++ b/examples/quick/animation/CMakeLists.txt @@ -20,80 +20,53 @@ find_package(Qt6 COMPONENTS Gui) find_package(Qt6 COMPONENTS Quick) find_package(Qt6 COMPONENTS Qml) -qt_add_executable(animation +add_subdirectory("../shared" "shared") + +qt_add_executable(animationexample main.cpp ) -set_target_properties(animation PROPERTIES +set_target_properties(animationexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) -target_link_libraries(animation PUBLIC +target_link_libraries(animationexample PUBLIC Qt::Core Qt::Gui Qt::Qml Qt::Quick + animation_shared ) - -# Resources: -set(shared_resource_files - "../shared/Button.qml" - "../shared/CheckBox.qml" - "../shared/FlickrRssModel.qml" - "../shared/Label.qml" - "../shared/LauncherList.qml" - "../shared/SimpleLauncherDelegate.qml" - "../shared/Slider.qml" - "../shared/TabSet.qml" - "../shared/TextField.qml" - "../shared/images/back.png" - "../shared/images/checkmark.png" - "../shared/images/next.png" - "../shared/images/qt-logo.png" - "../shared/images/slider_handle.png" - "../shared/images/tab.png" -) - -qt6_add_resources(animation "shared" - PREFIX - "/shared" - BASE - "../shared" - FILES - ${shared_resource_files} -) -set(animation_resource_files - "animation.qml" - "basics/animators.qml" - "basics/color-animation.qml" - "basics/images/face-smile.png" - "basics/images/moon.png" - "basics/images/shadow.png" - "basics/images/star.png" - "basics/images/sun.png" - "basics/property-animation.qml" - "behaviors/FocusRect.qml" - "behaviors/SideRect.qml" - "behaviors/behavior-example.qml" - "behaviors/tvtennis.qml" - "behaviors/wigglytext.qml" - "easing/easing.qml" - "pathanimation/pathanimation.qml" - "pathinterpolator/pathinterpolator.qml" - "states/qt-logo.png" - "states/states.qml" - "states/transitions.qml" -) - -qt6_add_resources(animation "animation" - PREFIX - "/animation" - FILES - ${animation_resource_files} +qt_add_qml_module(animationexample + URI animation + VERSION 1.0 + QML_FILES + "animation.qml" + "basics/animators.qml" + "basics/color-animation.qml" + "basics/property-animation.qml" + "behaviors/FocusRect.qml" + "behaviors/SideRect.qml" + "behaviors/behavior-example.qml" + "behaviors/tvtennis.qml" + "behaviors/wigglytext.qml" + "easing/easing.qml" + "pathanimation/pathanimation.qml" + "pathinterpolator/pathinterpolator.qml" + "states/states.qml" + "states/transitions.qml" + RESOURCES + "basics/images/face-smile.png" + "basics/images/moon.png" + "basics/images/shadow.png" + "basics/images/star.png" + "basics/images/sun.png" + "states/qt-logo.png" ) -install(TARGETS animation +install(TARGETS animationexample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) +bundle_shared(animationexample) diff --git a/examples/quick/animation/animation.qml b/examples/quick/animation/animation.qml index efc4e6fa27..2674bfee57 100644 --- a/examples/quick/animation/animation.qml +++ b/examples/quick/animation/animation.qml @@ -49,7 +49,7 @@ ****************************************************************************/ import QtQuick 2.0 -import "../shared" as Examples +import shared as Examples Item { height: 480 diff --git a/examples/quick/animation/animation.qmlproject b/examples/quick/animation/animation.qmlproject index 2e96daa881..94433ab9d0 100644 --- a/examples/quick/animation/animation.qmlproject +++ b/examples/quick/animation/animation.qmlproject @@ -2,6 +2,7 @@ import QmlProject 1.1 Project { mainFile: "animation.qml" + importPaths: ["../"] /* Include .qml, .js, and image files from current directory and subdirectories */ QmlFiles { |