diff options
Diffstat (limited to 'examples/quick/tutorials/samegame/samegame1')
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/Block.qml | 2 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/CMakeLists.txt | 51 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/main.cpp | 2 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/pics/background.jpg | bin | 0 -> 36473 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/pics/redStone.png | bin | 0 -> 2902 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/samegame.qml | 2 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/samegame1.pro | 5 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame1/samegame1.qrc | 4 |
8 files changed, 58 insertions, 8 deletions
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 Binary files differnew file mode 100644 index 0000000000..903d395c8d --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame1/pics/background.jpg diff --git a/examples/quick/tutorials/samegame/samegame1/pics/redStone.png b/examples/quick/tutorials/samegame/samegame1/pics/redStone.png Binary files differnew file mode 100644 index 0000000000..36b09a2686 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame1/pics/redStone.png 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 @@ <RCC> - <qresource prefix="/"> + <qresource prefix="/samegame"> <file>Button.qml</file> <file>Block.qml</file> <file>samegame.qml</file> + <file>pics/background.jpg</file> + <file>pics/redStone.png</file> </qresource> </RCC> |