diff options
Diffstat (limited to 'examples/quick/tutorials/samegame/samegame3')
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/Block.qml | 6 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/CMakeLists.txt | 55 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/main.cpp | 2 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/pics/background.jpg | bin | 0 -> 36473 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/pics/blueStone.png | bin | 0 -> 3054 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/pics/greenStone.png | bin | 0 -> 2932 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/pics/redStone.png | bin | 0 -> 2902 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/samegame.qml | 2 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/samegame3.pro | 5 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame3/samegame3.qrc | 7 |
10 files changed, 67 insertions, 10 deletions
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 Binary files differnew file mode 100644 index 0000000000..903d395c8d --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame3/pics/background.jpg diff --git a/examples/quick/tutorials/samegame/samegame3/pics/blueStone.png b/examples/quick/tutorials/samegame/samegame3/pics/blueStone.png Binary files differnew file mode 100644 index 0000000000..20e43c75b6 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame3/pics/blueStone.png diff --git a/examples/quick/tutorials/samegame/samegame3/pics/greenStone.png b/examples/quick/tutorials/samegame/samegame3/pics/greenStone.png Binary files differnew file mode 100644 index 0000000000..b568a1900c --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame3/pics/greenStone.png diff --git a/examples/quick/tutorials/samegame/samegame3/pics/redStone.png b/examples/quick/tutorials/samegame/samegame3/pics/redStone.png Binary files differnew file mode 100644 index 0000000000..36b09a2686 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame3/pics/redStone.png 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 @@ <RCC> - <qresource prefix="/"> + <qresource prefix="/samegame"> <file>Button.qml</file> <file>Block.qml</file> + <file>Dialog.qml</file> <file>samegame.qml</file> <file>samegame.js</file> + <file>pics/background.jpg</file> + <file>pics/blueStone.png</file> + <file>pics/greenStone.png</file> + <file>pics/redStone.png</file> </qresource> </RCC> |