From f6ca497fe43b0f5e976f296e8a4d425516508e51 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 30 Aug 2021 15:46:39 +0200 Subject: Fix samegame example to use QML modules In this case it really makes no sense to use a shared directory because we want to show the progressive changes between the different versions. It's actually important to note that we're adding the pictures one by one. Therefore, the shared directory is dissolved and the pictures added duplicated into the respective versions of samegame. Furthermore, moving the code into a "content" directory is a bad idea because it complicates the import logic. We don't want to make the "content" directory its own QML module. We might move samegame.qml into the "content" directory, too, and apply some path wrangling to make it work, but it's really not worth it here. Change-Id: Ifc45f48832596377c21bc6ef55e918ef487bc94e Reviewed-by: Andrei Golubev Reviewed-by: Mitch Curtis Reviewed-by: Shawn Rutledge Reviewed-by: Fabian Kosmale (cherry picked from commit a3ea7a99381748c457336bfa8b9373070ebfa3ee) Reviewed-by: Qt Cherry-pick Bot --- examples/quick/tutorials/CMakeLists.txt | 3 +- examples/quick/tutorials/samegame/CMakeLists.txt | 4 + .../quick/tutorials/samegame/samegame1/Block.qml | 2 +- .../tutorials/samegame/samegame1/CMakeLists.txt | 51 +++++ .../quick/tutorials/samegame/samegame1/main.cpp | 2 +- .../samegame/samegame1/pics/background.jpg | Bin 0 -> 36473 bytes .../tutorials/samegame/samegame1/pics/redStone.png | Bin 0 -> 2902 bytes .../tutorials/samegame/samegame1/samegame.qml | 2 +- .../tutorials/samegame/samegame1/samegame1.pro | 5 +- .../tutorials/samegame/samegame1/samegame1.qrc | 4 +- .../quick/tutorials/samegame/samegame2/Block.qml | 2 +- .../tutorials/samegame/samegame2/CMakeLists.txt | 52 +++++ .../quick/tutorials/samegame/samegame2/main.cpp | 2 +- .../samegame/samegame2/pics/background.jpg | Bin 0 -> 36473 bytes .../tutorials/samegame/samegame2/pics/redStone.png | Bin 0 -> 2902 bytes .../tutorials/samegame/samegame2/samegame.qml | 2 +- .../tutorials/samegame/samegame2/samegame2.pro | 5 +- .../tutorials/samegame/samegame2/samegame2.qrc | 4 +- .../quick/tutorials/samegame/samegame3/Block.qml | 6 +- .../tutorials/samegame/samegame3/CMakeLists.txt | 55 +++++ .../quick/tutorials/samegame/samegame3/main.cpp | 2 +- .../samegame/samegame3/pics/background.jpg | Bin 0 -> 36473 bytes .../samegame/samegame3/pics/blueStone.png | Bin 0 -> 3054 bytes .../samegame/samegame3/pics/greenStone.png | Bin 0 -> 2932 bytes .../tutorials/samegame/samegame3/pics/redStone.png | Bin 0 -> 2902 bytes .../tutorials/samegame/samegame3/samegame.qml | 2 +- .../tutorials/samegame/samegame3/samegame3.pro | 5 +- .../tutorials/samegame/samegame3/samegame3.qrc | 7 +- .../tutorials/samegame/samegame4/BoomBlock.qml | 139 +++++++++++++ .../quick/tutorials/samegame/samegame4/Button.qml | 91 +++++++++ .../tutorials/samegame/samegame4/CMakeLists.txt | 62 ++++++ .../quick/tutorials/samegame/samegame4/Dialog.qml | 117 +++++++++++ .../samegame/samegame4/content/BoomBlock.qml | 139 ------------- .../samegame/samegame4/content/Button.qml | 91 --------- .../samegame/samegame4/content/Dialog.qml | 117 ----------- .../samegame/samegame4/content/samegame.js | 227 --------------------- .../quick/tutorials/samegame/samegame4/main.cpp | 2 +- .../samegame/samegame4/pics/background.jpg | Bin 0 -> 36473 bytes .../tutorials/samegame/samegame4/pics/blueStar.png | Bin 0 -> 149 bytes .../samegame/samegame4/pics/blueStone.png | Bin 0 -> 3054 bytes .../samegame/samegame4/pics/greenStar.png | Bin 0 -> 149 bytes .../samegame/samegame4/pics/greenStone.png | Bin 0 -> 2932 bytes .../tutorials/samegame/samegame4/pics/redStar.png | Bin 0 -> 148 bytes .../tutorials/samegame/samegame4/pics/redStone.png | Bin 0 -> 2902 bytes .../quick/tutorials/samegame/samegame4/samegame.js | 227 +++++++++++++++++++++ .../tutorials/samegame/samegame4/samegame.qml | 5 +- .../tutorials/samegame/samegame4/samegame4.pro | 5 +- .../tutorials/samegame/samegame4/samegame4.qrc | 17 +- .../tutorials/samegame/shared/pics/background.jpg | Bin 36473 -> 0 bytes .../tutorials/samegame/shared/pics/blueStar.png | Bin 149 -> 0 bytes .../tutorials/samegame/shared/pics/blueStone.png | Bin 3054 -> 0 bytes .../tutorials/samegame/shared/pics/greenStar.png | Bin 149 -> 0 bytes .../tutorials/samegame/shared/pics/greenStone.png | Bin 2932 -> 0 bytes .../tutorials/samegame/shared/pics/redStar.png | Bin 148 -> 0 bytes .../tutorials/samegame/shared/pics/redStone.png | Bin 2902 -> 0 bytes .../tutorials/samegame/shared/pics/shared.qrc | 13 -- .../quick/tutorials/samegame/shared/pics/star.png | Bin 262 -> 0 bytes .../tutorials/samegame/shared/pics/yellowStone.png | Bin 3056 -> 0 bytes 58 files changed, 841 insertions(+), 628 deletions(-) create mode 100644 examples/quick/tutorials/samegame/CMakeLists.txt create mode 100644 examples/quick/tutorials/samegame/samegame1/CMakeLists.txt create mode 100644 examples/quick/tutorials/samegame/samegame1/pics/background.jpg create mode 100644 examples/quick/tutorials/samegame/samegame1/pics/redStone.png create mode 100644 examples/quick/tutorials/samegame/samegame2/CMakeLists.txt create mode 100644 examples/quick/tutorials/samegame/samegame2/pics/background.jpg create mode 100644 examples/quick/tutorials/samegame/samegame2/pics/redStone.png create mode 100644 examples/quick/tutorials/samegame/samegame3/CMakeLists.txt create mode 100644 examples/quick/tutorials/samegame/samegame3/pics/background.jpg create mode 100644 examples/quick/tutorials/samegame/samegame3/pics/blueStone.png create mode 100644 examples/quick/tutorials/samegame/samegame3/pics/greenStone.png create mode 100644 examples/quick/tutorials/samegame/samegame3/pics/redStone.png create mode 100644 examples/quick/tutorials/samegame/samegame4/BoomBlock.qml create mode 100644 examples/quick/tutorials/samegame/samegame4/Button.qml create mode 100644 examples/quick/tutorials/samegame/samegame4/CMakeLists.txt create mode 100644 examples/quick/tutorials/samegame/samegame4/Dialog.qml delete mode 100644 examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml delete mode 100644 examples/quick/tutorials/samegame/samegame4/content/Button.qml delete mode 100644 examples/quick/tutorials/samegame/samegame4/content/Dialog.qml delete mode 100644 examples/quick/tutorials/samegame/samegame4/content/samegame.js create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/background.jpg create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/blueStar.png create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/blueStone.png create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/greenStar.png create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/greenStone.png create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/redStar.png create mode 100644 examples/quick/tutorials/samegame/samegame4/pics/redStone.png create mode 100644 examples/quick/tutorials/samegame/samegame4/samegame.js delete mode 100644 examples/quick/tutorials/samegame/shared/pics/background.jpg delete mode 100644 examples/quick/tutorials/samegame/shared/pics/blueStar.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/blueStone.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/greenStar.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/greenStone.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/redStar.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/redStone.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/shared.qrc delete mode 100644 examples/quick/tutorials/samegame/shared/pics/star.png delete mode 100644 examples/quick/tutorials/samegame/shared/pics/yellowStone.png (limited to 'examples/quick') diff --git a/examples/quick/tutorials/CMakeLists.txt b/examples/quick/tutorials/CMakeLists.txt index 87d2caf01f..8777a16f50 100644 --- a/examples/quick/tutorials/CMakeLists.txt +++ b/examples/quick/tutorials/CMakeLists.txt @@ -1,2 +1 @@ -# Generated from tutorials.pro. - +add_subdirectory(samegame) diff --git a/examples/quick/tutorials/samegame/CMakeLists.txt b/examples/quick/tutorials/samegame/CMakeLists.txt new file mode 100644 index 0000000000..e0d5157a2c --- /dev/null +++ b/examples/quick/tutorials/samegame/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(samegame1) +add_subdirectory(samegame2) +add_subdirectory(samegame3) +add_subdirectory(samegame4) diff --git a/examples/quick/tutorials/samegame/samegame1/Block.qml b/examples/quick/tutorials/samegame/samegame1/Block.qml index eac8e93810..157a3aa0c9 100644 --- a/examples/quick/tutorials/samegame/samegame1/Block.qml +++ b/examples/quick/tutorials/samegame/samegame1/Block.qml @@ -57,7 +57,7 @@ Item { Image { id: img anchors.fill: parent - source: "../shared/pics/redStone.png" + source: "pics/redStone.png" } } //![0] diff --git a/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt new file mode 100644 index 0000000000..ad791d77b5 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame1/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.16) +project(samegame1 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame1") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS Qml) + +qt_add_executable(samegame1 + main.cpp +) +set_target_properties(samegame1 PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +qt_add_qml_module(samegame1 + URI samegame + VERSION 1.0 + QML_FILES + "Block.qml" + "Button.qml" + "samegame.qml" + RESOURCES + "pics/background.jpg" + "pics/redStone.png" +) + +target_link_libraries(samegame1 PRIVATE + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +install(TARGETS samegame1 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/quick/tutorials/samegame/samegame1/main.cpp b/examples/quick/tutorials/samegame/samegame1/main.cpp index 7589b92906..f76b5d8940 100644 --- a/examples/quick/tutorials/samegame/samegame1/main.cpp +++ b/examples/quick/tutorials/samegame/samegame1/main.cpp @@ -48,4 +48,4 @@ ** ****************************************************************************/ #include "../../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(samegame) +DECLARATIVE_EXAMPLE_MAIN(samegame/samegame) diff --git a/examples/quick/tutorials/samegame/samegame1/pics/background.jpg b/examples/quick/tutorials/samegame/samegame1/pics/background.jpg new file mode 100644 index 0000000000..903d395c8d Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame1/pics/background.jpg differ diff --git a/examples/quick/tutorials/samegame/samegame1/pics/redStone.png b/examples/quick/tutorials/samegame/samegame1/pics/redStone.png new file mode 100644 index 0000000000..36b09a2686 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame1/pics/redStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame1/samegame.qml b/examples/quick/tutorials/samegame/samegame1/samegame.qml index 68a1921da7..9eea87fc9c 100644 --- a/examples/quick/tutorials/samegame/samegame1/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame1/samegame.qml @@ -65,7 +65,7 @@ Rectangle { Image { id: background anchors.fill: parent - source: "../shared/pics/background.jpg" + source: "pics/background.jpg" fillMode: Image.PreserveAspectCrop } } diff --git a/examples/quick/tutorials/samegame/samegame1/samegame1.pro b/examples/quick/tutorials/samegame/samegame1/samegame1.pro index 9f316b6868..d523857d64 100644 --- a/examples/quick/tutorials/samegame/samegame1/samegame1.pro +++ b/examples/quick/tutorials/samegame/samegame1/samegame1.pro @@ -2,10 +2,7 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp - -RESOURCES += \ - samegame1.qrc \ - ../shared/pics/shared.qrc +RESOURCES += samegame1.qrc target.path = $$[QT_INSTALL_EXAMPLES]/quick/tutorials/samegame/samegame1 INSTALLS += target diff --git a/examples/quick/tutorials/samegame/samegame1/samegame1.qrc b/examples/quick/tutorials/samegame/samegame1/samegame1.qrc index 866cf899bf..1f061d606f 100644 --- a/examples/quick/tutorials/samegame/samegame1/samegame1.qrc +++ b/examples/quick/tutorials/samegame/samegame1/samegame1.qrc @@ -1,7 +1,9 @@ - + Button.qml Block.qml samegame.qml + pics/background.jpg + pics/redStone.png diff --git a/examples/quick/tutorials/samegame/samegame2/Block.qml b/examples/quick/tutorials/samegame/samegame2/Block.qml index 12cc0ea043..24672233b8 100644 --- a/examples/quick/tutorials/samegame/samegame2/Block.qml +++ b/examples/quick/tutorials/samegame/samegame2/Block.qml @@ -56,6 +56,6 @@ Item { Image { id: img anchors.fill: parent - source: "../shared/pics/redStone.png" + source: "pics/redStone.png" } } diff --git a/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt new file mode 100644 index 0000000000..5830622762 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.16) +project(samegame2 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame2") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS Qml) + +qt_add_executable(samegame2 + main.cpp +) +set_target_properties(samegame2 PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +qt_add_qml_module(samegame2 + URI samegame + VERSION 1.0 + QML_FILES + "Block.qml" + "Button.qml" + "samegame.qml" + "samegame.js" + RESOURCES + "pics/background.jpg" + "pics/redStone.png" +) + +target_link_libraries(samegame2 PRIVATE + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +install(TARGETS samegame2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/quick/tutorials/samegame/samegame2/main.cpp b/examples/quick/tutorials/samegame/samegame2/main.cpp index 7589b92906..f76b5d8940 100644 --- a/examples/quick/tutorials/samegame/samegame2/main.cpp +++ b/examples/quick/tutorials/samegame/samegame2/main.cpp @@ -48,4 +48,4 @@ ** ****************************************************************************/ #include "../../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(samegame) +DECLARATIVE_EXAMPLE_MAIN(samegame/samegame) diff --git a/examples/quick/tutorials/samegame/samegame2/pics/background.jpg b/examples/quick/tutorials/samegame/samegame2/pics/background.jpg new file mode 100644 index 0000000000..903d395c8d Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame2/pics/background.jpg differ diff --git a/examples/quick/tutorials/samegame/samegame2/pics/redStone.png b/examples/quick/tutorials/samegame/samegame2/pics/redStone.png new file mode 100644 index 0000000000..36b09a2686 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame2/pics/redStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame2/samegame.qml b/examples/quick/tutorials/samegame/samegame2/samegame.qml index 2c68fcf155..473b52f9ed 100644 --- a/examples/quick/tutorials/samegame/samegame2/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame2/samegame.qml @@ -67,7 +67,7 @@ Rectangle { Image { id: background anchors.fill: parent - source: "../shared/pics/background.jpg" + source: "pics/background.jpg" fillMode: Image.PreserveAspectCrop } } diff --git a/examples/quick/tutorials/samegame/samegame2/samegame2.pro b/examples/quick/tutorials/samegame/samegame2/samegame2.pro index 5ede9042cc..a0fc36e857 100644 --- a/examples/quick/tutorials/samegame/samegame2/samegame2.pro +++ b/examples/quick/tutorials/samegame/samegame2/samegame2.pro @@ -2,10 +2,7 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp - -RESOURCES += \ - samegame2.qrc \ - ../shared/pics/shared.qrc +RESOURCES += samegame2.qrc target.path = $$[QT_INSTALL_EXAMPLES]/quick/tutorials/samegame/samegame2 INSTALLS += target diff --git a/examples/quick/tutorials/samegame/samegame2/samegame2.qrc b/examples/quick/tutorials/samegame/samegame2/samegame2.qrc index 0f95174d83..f632e88f6a 100644 --- a/examples/quick/tutorials/samegame/samegame2/samegame2.qrc +++ b/examples/quick/tutorials/samegame/samegame2/samegame2.qrc @@ -1,8 +1,10 @@ - + Button.qml Block.qml samegame.qml samegame.js + pics/background.jpg + pics/redStone.png diff --git a/examples/quick/tutorials/samegame/samegame3/Block.qml b/examples/quick/tutorials/samegame/samegame3/Block.qml index d49bf89727..b543b06a7e 100644 --- a/examples/quick/tutorials/samegame/samegame3/Block.qml +++ b/examples/quick/tutorials/samegame/samegame3/Block.qml @@ -62,11 +62,11 @@ Item { anchors.fill: parent source: { if (type == 0) - return "../shared/pics/redStone.png"; + return "pics/redStone.png"; else if (type == 1) - return "../shared/pics/blueStone.png"; + return "pics/blueStone.png"; else - return "../shared/pics/greenStone.png"; + return "pics/greenStone.png"; } } } diff --git a/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt new file mode 100644 index 0000000000..0c3aa34b9d --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame3/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 3.16) +project(samegame3 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame3") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS Qml) + +qt_add_executable(samegame3 + main.cpp +) +set_target_properties(samegame3 PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +qt_add_qml_module(samegame3 + URI samegame + VERSION 1.0 + QML_FILES + "Block.qml" + "Button.qml" + "Dialog.qml" + "samegame.qml" + "samegame.js" + RESOURCES + "pics/background.jpg" + "pics/blueStone.png" + "pics/greenStone.png" + "pics/redStone.png" +) + +target_link_libraries(samegame3 PRIVATE + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +install(TARGETS samegame3 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/quick/tutorials/samegame/samegame3/main.cpp b/examples/quick/tutorials/samegame/samegame3/main.cpp index 7589b92906..f76b5d8940 100644 --- a/examples/quick/tutorials/samegame/samegame3/main.cpp +++ b/examples/quick/tutorials/samegame/samegame3/main.cpp @@ -48,4 +48,4 @@ ** ****************************************************************************/ #include "../../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(samegame) +DECLARATIVE_EXAMPLE_MAIN(samegame/samegame) diff --git a/examples/quick/tutorials/samegame/samegame3/pics/background.jpg b/examples/quick/tutorials/samegame/samegame3/pics/background.jpg new file mode 100644 index 0000000000..903d395c8d Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame3/pics/background.jpg differ diff --git a/examples/quick/tutorials/samegame/samegame3/pics/blueStone.png b/examples/quick/tutorials/samegame/samegame3/pics/blueStone.png new file mode 100644 index 0000000000..20e43c75b6 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame3/pics/blueStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame3/pics/greenStone.png b/examples/quick/tutorials/samegame/samegame3/pics/greenStone.png new file mode 100644 index 0000000000..b568a1900c Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame3/pics/greenStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame3/pics/redStone.png b/examples/quick/tutorials/samegame/samegame3/pics/redStone.png new file mode 100644 index 0000000000..36b09a2686 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame3/pics/redStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame3/samegame.qml b/examples/quick/tutorials/samegame/samegame3/samegame.qml index 11376232a2..a83cb01b7b 100644 --- a/examples/quick/tutorials/samegame/samegame3/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame3/samegame.qml @@ -66,7 +66,7 @@ Rectangle { Image { id: background anchors.fill: parent - source: "../shared/pics/background.jpg" + source: "pics/background.jpg" fillMode: Image.PreserveAspectCrop } diff --git a/examples/quick/tutorials/samegame/samegame3/samegame3.pro b/examples/quick/tutorials/samegame/samegame3/samegame3.pro index 7b99673e57..88f8f87699 100644 --- a/examples/quick/tutorials/samegame/samegame3/samegame3.pro +++ b/examples/quick/tutorials/samegame/samegame3/samegame3.pro @@ -2,10 +2,7 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp - -RESOURCES += \ - samegame3.qrc \ - ../shared/pics/shared.qrc +RESOURCES += samegame3.qrc target.path = $$[QT_INSTALL_EXAMPLES]/quick/tutorials/samegame/samegame3 INSTALLS += target diff --git a/examples/quick/tutorials/samegame/samegame3/samegame3.qrc b/examples/quick/tutorials/samegame/samegame3/samegame3.qrc index 0f95174d83..16c90b4516 100644 --- a/examples/quick/tutorials/samegame/samegame3/samegame3.qrc +++ b/examples/quick/tutorials/samegame/samegame3/samegame3.qrc @@ -1,8 +1,13 @@ - + Button.qml Block.qml + Dialog.qml samegame.qml samegame.js + pics/background.jpg + pics/blueStone.png + pics/greenStone.png + pics/redStone.png diff --git a/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml b/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml new file mode 100644 index 0000000000..8353437542 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame4/BoomBlock.qml @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: block + + property int type: 0 + property bool dying: false + + //![1] + property bool spawned: false + + Behavior on x { + enabled: block.spawned; + SpringAnimation{ spring: 2; damping: 0.2 } + } + Behavior on y { + SpringAnimation{ spring: 2; damping: 0.2 } + } + //![1] + + //![2] + Image { + id: img + + anchors.fill: parent + source: { + if (block.type == 0) + return "pics/redStone.png"; + else if (block.type == 1) + return "pics/blueStone.png"; + else + return "pics/greenStone.png"; + } + opacity: 0 + + Behavior on opacity { + NumberAnimation { properties:"opacity"; duration: 200 } + } + } + //![2] + + //![3] + ParticleSystem { + id: sys + anchors.centerIn: parent + ImageParticle { + // ![0] + source: { + if (block.type == 0) + return "pics/redStar.png"; + else if (block.type == 1) + return "pics/blueStar.png"; + else + return "pics/greenStar.png"; + } + rotationVelocityVariation: 360 + // ![0] + } + + Emitter { + id: particles + anchors.centerIn: parent + emitRate: 0 + lifeSpan: 700 + velocity: AngleDirection {angleVariation: 360; magnitude: 80; magnitudeVariation: 40} + size: 16 + } + } + //![3] + + //![4] + states: [ + State { + name: "AliveState" + when: block.spawned == true && block.dying == false + PropertyChanges { target: img; opacity: 1 } + }, + + State { + name: "DeathState" + when: block.dying == true + StateChangeScript { script: particles.burst(50); } + PropertyChanges { target: img; opacity: 0 } + StateChangeScript { script: block.destroy(1000); } + } + ] + //![4] +} diff --git a/examples/quick/tutorials/samegame/samegame4/Button.qml b/examples/quick/tutorials/samegame/samegame4/Button.qml new file mode 100644 index 0000000000..77921772d2 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame4/Button.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + id: container + + property string text: "Button" + + signal clicked + + width: buttonLabel.width + 20; height: buttonLabel.height + 5 + border { width: 1; color: Qt.darker(activePalette.button) } + antialiasing: true + radius: 8 + + // color the button with a gradient + gradient: Gradient { + GradientStop { + position: 0.0 + color: { + if (mouseArea.pressed) + return activePalette.dark + else + return activePalette.light + } + } + GradientStop { position: 1.0; color: activePalette.button } + } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: container.clicked(); + } + + Text { + id: buttonLabel + anchors.centerIn: container + color: activePalette.buttonText + text: container.text + } +} diff --git a/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt new file mode 100644 index 0000000000..c89d191873 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame4/CMakeLists.txt @@ -0,0 +1,62 @@ +cmake_minimum_required(VERSION 3.16) +project(samegame4 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +if(NOT DEFINED INSTALL_EXAMPLESDIR) + set(INSTALL_EXAMPLESDIR "examples") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/tutorials/samegame/samegame4") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS Qml) + +qt_add_executable(samegame4 + main.cpp +) +set_target_properties(samegame4 PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +qt_add_qml_module(samegame4 + URI samegame + VERSION 1.0 + QML_FILES + "BoomBlock.qml" + "Button.qml" + "Dialog.qml" + "samegame.qml" + "samegame.js" + RESOURCES + "highscores/README" + "highscores/score_data.xml" + "highscores/score_style.xsl" + "highscores/scores.php" + "pics/background.jpg" + "pics/blueStar.png" + "pics/blueStone.png" + "pics/greenStar.png" + "pics/greenStone.png" + "pics/redStar.png" + "pics/redStone.png" +) + +target_link_libraries(samegame4 PRIVATE + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +install(TARGETS samegame4 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/quick/tutorials/samegame/samegame4/Dialog.qml b/examples/quick/tutorials/samegame/samegame4/Dialog.qml new file mode 100644 index 0000000000..5663add8ad --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame4/Dialog.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +//![0] +Rectangle { + id: container +//![0] + +//![1] + property string inputText: textInput.text + signal closed + + function show(text) { + dialogText.text = text; + container.opacity = 1; + textInput.opacity = 0; + } + + function showWithInput(text) { + show(text); + textInput.opacity = 1; + textInput.focus = true; + textInput.text = "" + } + + function hide() { + textInput.focus = false; + container.opacity = 0; + container.closed(); + } +//![1] + + width: dialogText.width + textInput.width + 20 + height: dialogText.height + 20 + opacity: 0 + visible: opacity > 0 + + Text { + id: dialogText + anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 } + text: "" + } + +//![2] + TextInput { + id: textInput + anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } + width: 80 + text: "" + + onAccepted: container.hide() // close dialog when Enter is pressed + } +//![2] + + MouseArea { + anchors.fill: parent + + onClicked: { + if (textInput.text == "" && textInput.opacity > 0) + Qt.inputMethod.show(); + else + hide(); + } + } + +//![3] +} +//![3] diff --git a/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml deleted file mode 100644 index 12cc64a09b..0000000000 --- a/examples/quick/tutorials/samegame/samegame4/content/BoomBlock.qml +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Particles 2.0 - -Item { - id: block - - property int type: 0 - property bool dying: false - - //![1] - property bool spawned: false - - Behavior on x { - enabled: block.spawned; - SpringAnimation{ spring: 2; damping: 0.2 } - } - Behavior on y { - SpringAnimation{ spring: 2; damping: 0.2 } - } - //![1] - - //![2] - Image { - id: img - - anchors.fill: parent - source: { - if (block.type == 0) - return "../../shared/pics/redStone.png"; - else if (block.type == 1) - return "../../shared/pics/blueStone.png"; - else - return "../../shared/pics/greenStone.png"; - } - opacity: 0 - - Behavior on opacity { - NumberAnimation { properties:"opacity"; duration: 200 } - } - } - //![2] - - //![3] - ParticleSystem { - id: sys - anchors.centerIn: parent - ImageParticle { - // ![0] - source: { - if (block.type == 0) - return "../../shared/pics/redStar.png"; - else if (block.type == 1) - return "../../shared/pics/blueStar.png"; - else - return "../../shared/pics/greenStar.png"; - } - rotationVelocityVariation: 360 - // ![0] - } - - Emitter { - id: particles - anchors.centerIn: parent - emitRate: 0 - lifeSpan: 700 - velocity: AngleDirection {angleVariation: 360; magnitude: 80; magnitudeVariation: 40} - size: 16 - } - } - //![3] - - //![4] - states: [ - State { - name: "AliveState" - when: block.spawned == true && block.dying == false - PropertyChanges { target: img; opacity: 1 } - }, - - State { - name: "DeathState" - when: block.dying == true - StateChangeScript { script: particles.burst(50); } - PropertyChanges { target: img; opacity: 0 } - StateChangeScript { script: block.destroy(1000); } - } - ] - //![4] -} diff --git a/examples/quick/tutorials/samegame/samegame4/content/Button.qml b/examples/quick/tutorials/samegame/samegame4/content/Button.qml deleted file mode 100644 index 77921772d2..0000000000 --- a/examples/quick/tutorials/samegame/samegame4/content/Button.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - id: container - - property string text: "Button" - - signal clicked - - width: buttonLabel.width + 20; height: buttonLabel.height + 5 - border { width: 1; color: Qt.darker(activePalette.button) } - antialiasing: true - radius: 8 - - // color the button with a gradient - gradient: Gradient { - GradientStop { - position: 0.0 - color: { - if (mouseArea.pressed) - return activePalette.dark - else - return activePalette.light - } - } - GradientStop { position: 1.0; color: activePalette.button } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: container.clicked(); - } - - Text { - id: buttonLabel - anchors.centerIn: container - color: activePalette.buttonText - text: container.text - } -} diff --git a/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml b/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml deleted file mode 100644 index 5663add8ad..0000000000 --- a/examples/quick/tutorials/samegame/samegame4/content/Dialog.qml +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -//![0] -Rectangle { - id: container -//![0] - -//![1] - property string inputText: textInput.text - signal closed - - function show(text) { - dialogText.text = text; - container.opacity = 1; - textInput.opacity = 0; - } - - function showWithInput(text) { - show(text); - textInput.opacity = 1; - textInput.focus = true; - textInput.text = "" - } - - function hide() { - textInput.focus = false; - container.opacity = 0; - container.closed(); - } -//![1] - - width: dialogText.width + textInput.width + 20 - height: dialogText.height + 20 - opacity: 0 - visible: opacity > 0 - - Text { - id: dialogText - anchors { verticalCenter: parent.verticalCenter; left: parent.left; leftMargin: 10 } - text: "" - } - -//![2] - TextInput { - id: textInput - anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - width: 80 - text: "" - - onAccepted: container.hide() // close dialog when Enter is pressed - } -//![2] - - MouseArea { - anchors.fill: parent - - onClicked: { - if (textInput.text == "" && textInput.opacity > 0) - Qt.inputMethod.show(); - else - hide(); - } - } - -//![3] -} -//![3] diff --git a/examples/quick/tutorials/samegame/samegame4/content/samegame.js b/examples/quick/tutorials/samegame/samegame4/content/samegame.js deleted file mode 100644 index 80b175d450..0000000000 --- a/examples/quick/tutorials/samegame/samegame4/content/samegame.js +++ /dev/null @@ -1,227 +0,0 @@ -/* This script file handles the game logic */ -.import QtQuick.LocalStorage 2.0 as Sql -.import QtQuick 2.0 as Quick - -var maxColumn = 10; -var maxRow = 15; -var maxIndex = maxColumn * maxRow; -var board = new Array(maxIndex); -var component; -var scoresURL = ""; -var gameDuration; - -//Index function used instead of a 2D array -function index(column, row) { - return column + (row * maxColumn); -} - -function startNewGame() { - //Delete blocks from previous game - for (var i = 0; i < maxIndex; i++) { - if (board[i] != null) - board[i].destroy(); - } - - //Calculate board size - maxColumn = Math.floor(gameCanvas.width / gameCanvas.blockSize); - maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize); - maxIndex = maxRow * maxColumn; - - //Close dialogs - nameInputDialog.hide(); - dialog.hide(); - - //Initialize Board - board = new Array(maxIndex); - gameCanvas.score = 0; - for (var column = 0; column < maxColumn; column++) { - for (var row = 0; row < maxRow; row++) { - board[index(column, row)] = null; - createBlock(column, row); - } - } - - gameDuration = new Date(); -} - -function createBlock(column, row) { - if (component == null) - component = Qt.createComponent("BoomBlock.qml"); - - // Note that if Block.qml was not a local file, component.status would be - // Loading and we should wait for the component's statusChanged() signal to - // know when the file is downloaded and ready before calling createObject(). - if (component.status == Quick.Component.Ready) { - var dynamicObject = component.createObject(gameCanvas); - if (dynamicObject == null) { - console.log("error creating block"); - console.log(component.errorString()); - return false; - } - dynamicObject.type = Math.floor(Math.random() * 3); - dynamicObject.x = column * gameCanvas.blockSize; - dynamicObject.y = row * gameCanvas.blockSize; - dynamicObject.width = gameCanvas.blockSize; - dynamicObject.height = gameCanvas.blockSize; - dynamicObject.spawned = true; - board[index(column, row)] = dynamicObject; - } else { - console.log("error loading block component"); - console.log(component.errorString()); - return false; - } - return true; -} - -var fillFound; //Set after a floodFill call to the number of blocks found -var floodBoard; //Set to 1 if the floodFill reaches off that node - -function handleClick(xPos, yPos) { - var column = Math.floor(xPos / gameCanvas.blockSize); - var row = Math.floor(yPos / gameCanvas.blockSize); - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if (board[index(column, row)] == null) - return; - //If it's a valid block, remove it and all connected (does nothing if it's not connected) - floodFill(column, row, -1); - if (fillFound <= 0) - return; - gameCanvas.score += (fillFound - 1) * (fillFound - 1); - shuffleDown(); - victoryCheck(); -} - -function floodFill(column, row, type) { - if (board[index(column, row)] == null) - return; - var first = false; - if (type == -1) { - first = true; - type = board[index(column, row)].type; - - //Flood fill initialization - fillFound = 0; - floodBoard = new Array(maxIndex); - } - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return; - if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type)) - return; - floodBoard[index(column, row)] = 1; - floodFill(column + 1, row, type); - floodFill(column - 1, row, type); - floodFill(column, row + 1, type); - floodFill(column, row - 1, type); - if (first == true && fillFound == 0) - return; //Can't remove single blocks - board[index(column, row)].dying = true; - board[index(column, row)] = null; - fillFound += 1; -} - -function shuffleDown() { - //Fall down - for (var column = 0; column < maxColumn; column++) { - var fallDist = 0; - for (var row = maxRow - 1; row >= 0; row--) { - if (board[index(column, row)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - var obj = board[index(column, row)]; - obj.y = (row + fallDist) * gameCanvas.blockSize; - board[index(column, row + fallDist)] = obj; - board[index(column, row)] = null; - } - } - } - } - //Fall to the left - fallDist = 0; - for (column = 0; column < maxColumn; column++) { - if (board[index(column, maxRow - 1)] == null) { - fallDist += 1; - } else { - if (fallDist > 0) { - for (row = 0; row < maxRow; row++) { - obj = board[index(column, row)]; - if (obj == null) - continue; - obj.x = (column - fallDist) * gameCanvas.blockSize; - board[index(column - fallDist, row)] = obj; - board[index(column, row)] = null; - } - } - } - } -} - -//![3] -function victoryCheck() { -//![3] - //Award bonus points if no blocks left - var deservesBonus = true; - for (var column = maxColumn - 1; column >= 0; column--) - if (board[index(column, maxRow - 1)] != null) - deservesBonus = false; - if (deservesBonus) - gameCanvas.score += 500; - -//![4] - //Check whether game has finished - if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) { - gameDuration = new Date() - gameDuration; - nameInputDialog.showWithInput("You won! Please enter your name: "); - } -} -//![4] - -//only floods up and right, to see if it can find adjacent same-typed blocks -function floodMoveCheck(column, row, type) { - if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) - return false; - if (board[index(column, row)] == null) - return false; - var myType = board[index(column, row)].type; - if (type == myType) - return true; - return floodMoveCheck(column + 1, row, myType) || floodMoveCheck(column, row - 1, board[index(column, row)].type); -} - -//![2] -function saveHighScore(name) { - if (scoresURL != "") - sendHighScore(name); - - var db = Sql.LocalStorage.openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores", 100); - var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; - var data = [name, gameCanvas.score, maxColumn + "x" + maxRow, Math.floor(gameDuration / 1000)]; - db.transaction(function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); - tx.executeSql(dataStr, data); - - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10'); - var r = "\nHIGH SCORES for a standard sized grid\n\n" - for (var i = 0; i < rs.rows.length; i++) { - r += (i + 1) + ". " + rs.rows.item(i).name + ' got ' + rs.rows.item(i).score + ' points in ' + rs.rows.item(i).time + ' seconds.\n'; - } - dialog.show(r); - }); -} -//![2] - -//![1] -function sendHighScore(name) { - var postman = new XMLHttpRequest() - var postData = "name=" + name + "&score=" + gameCanvas.score + "&gridSize=" + maxColumn + "x" + maxRow + "&time=" + Math.floor(gameDuration / 1000); - postman.open("POST", scoresURL, true); - postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - postman.onreadystatechange = function() { - if (postman.readyState == postman.DONE) { - dialog.show("Your score has been uploaded."); - } - } - postman.send(postData); -} -//![1] diff --git a/examples/quick/tutorials/samegame/samegame4/main.cpp b/examples/quick/tutorials/samegame/samegame4/main.cpp index 7589b92906..f76b5d8940 100644 --- a/examples/quick/tutorials/samegame/samegame4/main.cpp +++ b/examples/quick/tutorials/samegame/samegame4/main.cpp @@ -48,4 +48,4 @@ ** ****************************************************************************/ #include "../../../shared/shared.h" -DECLARATIVE_EXAMPLE_MAIN(samegame) +DECLARATIVE_EXAMPLE_MAIN(samegame/samegame) diff --git a/examples/quick/tutorials/samegame/samegame4/pics/background.jpg b/examples/quick/tutorials/samegame/samegame4/pics/background.jpg new file mode 100644 index 0000000000..903d395c8d Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/background.jpg differ diff --git a/examples/quick/tutorials/samegame/samegame4/pics/blueStar.png b/examples/quick/tutorials/samegame/samegame4/pics/blueStar.png new file mode 100644 index 0000000000..213bb4bf6c Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/blueStar.png differ diff --git a/examples/quick/tutorials/samegame/samegame4/pics/blueStone.png b/examples/quick/tutorials/samegame/samegame4/pics/blueStone.png new file mode 100644 index 0000000000..20e43c75b6 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/blueStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame4/pics/greenStar.png b/examples/quick/tutorials/samegame/samegame4/pics/greenStar.png new file mode 100644 index 0000000000..38429749b8 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/greenStar.png differ diff --git a/examples/quick/tutorials/samegame/samegame4/pics/greenStone.png b/examples/quick/tutorials/samegame/samegame4/pics/greenStone.png new file mode 100644 index 0000000000..b568a1900c Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/greenStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame4/pics/redStar.png b/examples/quick/tutorials/samegame/samegame4/pics/redStar.png new file mode 100644 index 0000000000..5cdf45c4c0 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/redStar.png differ diff --git a/examples/quick/tutorials/samegame/samegame4/pics/redStone.png b/examples/quick/tutorials/samegame/samegame4/pics/redStone.png new file mode 100644 index 0000000000..36b09a2686 Binary files /dev/null and b/examples/quick/tutorials/samegame/samegame4/pics/redStone.png differ diff --git a/examples/quick/tutorials/samegame/samegame4/samegame.js b/examples/quick/tutorials/samegame/samegame4/samegame.js new file mode 100644 index 0000000000..80b175d450 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame4/samegame.js @@ -0,0 +1,227 @@ +/* This script file handles the game logic */ +.import QtQuick.LocalStorage 2.0 as Sql +.import QtQuick 2.0 as Quick + +var maxColumn = 10; +var maxRow = 15; +var maxIndex = maxColumn * maxRow; +var board = new Array(maxIndex); +var component; +var scoresURL = ""; +var gameDuration; + +//Index function used instead of a 2D array +function index(column, row) { + return column + (row * maxColumn); +} + +function startNewGame() { + //Delete blocks from previous game + for (var i = 0; i < maxIndex; i++) { + if (board[i] != null) + board[i].destroy(); + } + + //Calculate board size + maxColumn = Math.floor(gameCanvas.width / gameCanvas.blockSize); + maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize); + maxIndex = maxRow * maxColumn; + + //Close dialogs + nameInputDialog.hide(); + dialog.hide(); + + //Initialize Board + board = new Array(maxIndex); + gameCanvas.score = 0; + for (var column = 0; column < maxColumn; column++) { + for (var row = 0; row < maxRow; row++) { + board[index(column, row)] = null; + createBlock(column, row); + } + } + + gameDuration = new Date(); +} + +function createBlock(column, row) { + if (component == null) + component = Qt.createComponent("BoomBlock.qml"); + + // Note that if Block.qml was not a local file, component.status would be + // Loading and we should wait for the component's statusChanged() signal to + // know when the file is downloaded and ready before calling createObject(). + if (component.status == Quick.Component.Ready) { + var dynamicObject = component.createObject(gameCanvas); + if (dynamicObject == null) { + console.log("error creating block"); + console.log(component.errorString()); + return false; + } + dynamicObject.type = Math.floor(Math.random() * 3); + dynamicObject.x = column * gameCanvas.blockSize; + dynamicObject.y = row * gameCanvas.blockSize; + dynamicObject.width = gameCanvas.blockSize; + dynamicObject.height = gameCanvas.blockSize; + dynamicObject.spawned = true; + board[index(column, row)] = dynamicObject; + } else { + console.log("error loading block component"); + console.log(component.errorString()); + return false; + } + return true; +} + +var fillFound; //Set after a floodFill call to the number of blocks found +var floodBoard; //Set to 1 if the floodFill reaches off that node + +function handleClick(xPos, yPos) { + var column = Math.floor(xPos / gameCanvas.blockSize); + var row = Math.floor(yPos / gameCanvas.blockSize); + if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) + return; + if (board[index(column, row)] == null) + return; + //If it's a valid block, remove it and all connected (does nothing if it's not connected) + floodFill(column, row, -1); + if (fillFound <= 0) + return; + gameCanvas.score += (fillFound - 1) * (fillFound - 1); + shuffleDown(); + victoryCheck(); +} + +function floodFill(column, row, type) { + if (board[index(column, row)] == null) + return; + var first = false; + if (type == -1) { + first = true; + type = board[index(column, row)].type; + + //Flood fill initialization + fillFound = 0; + floodBoard = new Array(maxIndex); + } + if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) + return; + if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type)) + return; + floodBoard[index(column, row)] = 1; + floodFill(column + 1, row, type); + floodFill(column - 1, row, type); + floodFill(column, row + 1, type); + floodFill(column, row - 1, type); + if (first == true && fillFound == 0) + return; //Can't remove single blocks + board[index(column, row)].dying = true; + board[index(column, row)] = null; + fillFound += 1; +} + +function shuffleDown() { + //Fall down + for (var column = 0; column < maxColumn; column++) { + var fallDist = 0; + for (var row = maxRow - 1; row >= 0; row--) { + if (board[index(column, row)] == null) { + fallDist += 1; + } else { + if (fallDist > 0) { + var obj = board[index(column, row)]; + obj.y = (row + fallDist) * gameCanvas.blockSize; + board[index(column, row + fallDist)] = obj; + board[index(column, row)] = null; + } + } + } + } + //Fall to the left + fallDist = 0; + for (column = 0; column < maxColumn; column++) { + if (board[index(column, maxRow - 1)] == null) { + fallDist += 1; + } else { + if (fallDist > 0) { + for (row = 0; row < maxRow; row++) { + obj = board[index(column, row)]; + if (obj == null) + continue; + obj.x = (column - fallDist) * gameCanvas.blockSize; + board[index(column - fallDist, row)] = obj; + board[index(column, row)] = null; + } + } + } + } +} + +//![3] +function victoryCheck() { +//![3] + //Award bonus points if no blocks left + var deservesBonus = true; + for (var column = maxColumn - 1; column >= 0; column--) + if (board[index(column, maxRow - 1)] != null) + deservesBonus = false; + if (deservesBonus) + gameCanvas.score += 500; + +//![4] + //Check whether game has finished + if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) { + gameDuration = new Date() - gameDuration; + nameInputDialog.showWithInput("You won! Please enter your name: "); + } +} +//![4] + +//only floods up and right, to see if it can find adjacent same-typed blocks +function floodMoveCheck(column, row, type) { + if (column >= maxColumn || column < 0 || row >= maxRow || row < 0) + return false; + if (board[index(column, row)] == null) + return false; + var myType = board[index(column, row)].type; + if (type == myType) + return true; + return floodMoveCheck(column + 1, row, myType) || floodMoveCheck(column, row - 1, board[index(column, row)].type); +} + +//![2] +function saveHighScore(name) { + if (scoresURL != "") + sendHighScore(name); + + var db = Sql.LocalStorage.openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores", 100); + var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; + var data = [name, gameCanvas.score, maxColumn + "x" + maxRow, Math.floor(gameDuration / 1000)]; + db.transaction(function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); + tx.executeSql(dataStr, data); + + var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10'); + var r = "\nHIGH SCORES for a standard sized grid\n\n" + for (var i = 0; i < rs.rows.length; i++) { + r += (i + 1) + ". " + rs.rows.item(i).name + ' got ' + rs.rows.item(i).score + ' points in ' + rs.rows.item(i).time + ' seconds.\n'; + } + dialog.show(r); + }); +} +//![2] + +//![1] +function sendHighScore(name) { + var postman = new XMLHttpRequest() + var postData = "name=" + name + "&score=" + gameCanvas.score + "&gridSize=" + maxColumn + "x" + maxRow + "&time=" + Math.floor(gameDuration / 1000); + postman.open("POST", scoresURL, true); + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + postman.onreadystatechange = function() { + if (postman.readyState == postman.DONE) { + dialog.show("Your score has been uploaded."); + } + } + postman.send(postData); +} +//![1] diff --git a/examples/quick/tutorials/samegame/samegame4/samegame.qml b/examples/quick/tutorials/samegame/samegame4/samegame.qml index 0cdbcd8cb0..1335024b13 100644 --- a/examples/quick/tutorials/samegame/samegame4/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame4/samegame.qml @@ -49,8 +49,7 @@ ****************************************************************************/ import QtQuick 2.0 -import "content" -import "content/samegame.js" as SameGame +import "samegame.js" as SameGame Rectangle { id: screen @@ -66,7 +65,7 @@ Rectangle { Image { id: background anchors.fill: parent - source: "../shared/pics/background.jpg" + source: "pics/background.jpg" fillMode: Image.PreserveAspectCrop } diff --git a/examples/quick/tutorials/samegame/samegame4/samegame4.pro b/examples/quick/tutorials/samegame/samegame4/samegame4.pro index 5da0d46e19..e9d341d555 100644 --- a/examples/quick/tutorials/samegame/samegame4/samegame4.pro +++ b/examples/quick/tutorials/samegame/samegame4/samegame4.pro @@ -2,10 +2,7 @@ TEMPLATE = app QT += quick qml SOURCES += main.cpp - -RESOURCES += \ - samegame4.qrc \ - ../shared/pics/shared.qrc +RESOURCES += samegame4.qrc target.path = $$[QT_INSTALL_EXAMPLES]/quick/tutorials/samegame/samegame4 INSTALLS += target diff --git a/examples/quick/tutorials/samegame/samegame4/samegame4.qrc b/examples/quick/tutorials/samegame/samegame4/samegame4.qrc index 8b130721f5..9dc482d7de 100644 --- a/examples/quick/tutorials/samegame/samegame4/samegame4.qrc +++ b/examples/quick/tutorials/samegame/samegame4/samegame4.qrc @@ -1,13 +1,20 @@ - + samegame.qml - content/BoomBlock.qml - content/Button.qml - content/Dialog.qml - content/samegame.js + BoomBlock.qml + Button.qml + Dialog.qml + samegame.js highscores/README highscores/score_data.xml highscores/score_style.xsl highscores/scores.php + pics/background.jpg + pics/blueStar.png + pics/blueStone.png + pics/greenStar.png + pics/greenStone.png + pics/redStar.png + pics/redStone.png diff --git a/examples/quick/tutorials/samegame/shared/pics/background.jpg b/examples/quick/tutorials/samegame/shared/pics/background.jpg deleted file mode 100644 index 903d395c8d..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/background.jpg and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/blueStar.png b/examples/quick/tutorials/samegame/shared/pics/blueStar.png deleted file mode 100644 index 213bb4bf6c..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/blueStar.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/blueStone.png b/examples/quick/tutorials/samegame/shared/pics/blueStone.png deleted file mode 100644 index 20e43c75b6..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/blueStone.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/greenStar.png b/examples/quick/tutorials/samegame/shared/pics/greenStar.png deleted file mode 100644 index 38429749b8..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/greenStar.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/greenStone.png b/examples/quick/tutorials/samegame/shared/pics/greenStone.png deleted file mode 100644 index b568a1900c..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/greenStone.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/redStar.png b/examples/quick/tutorials/samegame/shared/pics/redStar.png deleted file mode 100644 index 5cdf45c4c0..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/redStar.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/redStone.png b/examples/quick/tutorials/samegame/shared/pics/redStone.png deleted file mode 100644 index 36b09a2686..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/redStone.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/shared.qrc b/examples/quick/tutorials/samegame/shared/pics/shared.qrc deleted file mode 100644 index 8982a9face..0000000000 --- a/examples/quick/tutorials/samegame/shared/pics/shared.qrc +++ /dev/null @@ -1,13 +0,0 @@ - - - background.jpg - blueStar.png - blueStone.png - greenStar.png - greenStone.png - redStar.png - redStone.png - star.png - yellowStone.png - - diff --git a/examples/quick/tutorials/samegame/shared/pics/star.png b/examples/quick/tutorials/samegame/shared/pics/star.png deleted file mode 100644 index defbde53ca..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/star.png and /dev/null differ diff --git a/examples/quick/tutorials/samegame/shared/pics/yellowStone.png b/examples/quick/tutorials/samegame/shared/pics/yellowStone.png deleted file mode 100644 index b1ce76212c..0000000000 Binary files a/examples/quick/tutorials/samegame/shared/pics/yellowStone.png and /dev/null differ -- cgit v1.2.3