diff options
Diffstat (limited to 'examples/quick/tutorials/samegame/samegame2')
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/Block.qml | 55 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/Button.qml | 53 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/CMakeLists.txt | 54 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/main.cpp | 53 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/pics/background.jpg | bin | 0 -> 36473 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/pics/redStone.png | bin | 0 -> 2902 bytes | |||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/samegame.qml | 55 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/samegame2.pro | 5 | ||||
-rw-r--r-- | examples/quick/tutorials/samegame/samegame2/samegame2.qrc | 4 |
9 files changed, 72 insertions, 207 deletions
diff --git a/examples/quick/tutorials/samegame/samegame2/Block.qml b/examples/quick/tutorials/samegame/samegame2/Block.qml index 12cc0ea043..b0416f0e15 100644 --- a/examples/quick/tutorials/samegame/samegame2/Block.qml +++ b/examples/quick/tutorials/samegame/samegame2/Block.qml @@ -1,54 +1,7 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 +import QtQuick Item { id: block @@ -56,6 +9,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/Button.qml b/examples/quick/tutorials/samegame/samegame2/Button.qml index 77921772d2..1a365e6dd9 100644 --- a/examples/quick/tutorials/samegame/samegame2/Button.qml +++ b/examples/quick/tutorials/samegame/samegame2/Button.qml @@ -1,54 +1,7 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 +import QtQuick Rectangle { id: container diff --git a/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt b/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt new file mode 100644 index 0000000000..3fe42e4cd4 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame2/CMakeLists.txt @@ -0,0 +1,54 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +cmake_minimum_required(VERSION 3.16) +project(samegame2 LANGUAGES CXX) + +set(CMAKE_AUTOMOC ON) + +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) + +qt_standard_project_setup(REQUIRES 6.5) + +qt_add_executable(samegame2 + main.cpp +) + +set_target_properties(samegame2 PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) + +qt_add_qml_module(samegame2 + URI samegame + QML_FILES + "Block.qml" + "Button.qml" + "samegame.qml" + "samegame.js" + RESOURCES + "pics/background.jpg" + "pics/redStone.png" +) + +target_link_libraries(samegame2 PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Qml + Qt6::Quick +) + +install(TARGETS samegame2 + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +qt_generate_deploy_qml_app_script( + TARGET samegame2 + OUTPUT_SCRIPT deploy_script + MACOS_BUNDLE_POST_BUILD + NO_UNSUPPORTED_PLATFORM_ERROR + DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM +) +install(SCRIPT ${deploy_script}) diff --git a/examples/quick/tutorials/samegame/samegame2/main.cpp b/examples/quick/tutorials/samegame/samegame2/main.cpp index 7589b92906..164b47aebd 100644 --- a/examples/quick/tutorials/samegame/samegame2/main.cpp +++ b/examples/quick/tutorials/samegame/samegame2/main.cpp @@ -1,51 +1,4 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #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 Binary files differnew file mode 100644 index 0000000000..903d395c8d --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame2/pics/background.jpg diff --git a/examples/quick/tutorials/samegame/samegame2/pics/redStone.png b/examples/quick/tutorials/samegame/samegame2/pics/redStone.png Binary files differnew file mode 100644 index 0000000000..36b09a2686 --- /dev/null +++ b/examples/quick/tutorials/samegame/samegame2/pics/redStone.png diff --git a/examples/quick/tutorials/samegame/samegame2/samegame.qml b/examples/quick/tutorials/samegame/samegame2/samegame.qml index 2c68fcf155..642a474ebd 100644 --- a/examples/quick/tutorials/samegame/samegame2/samegame.qml +++ b/examples/quick/tutorials/samegame/samegame2/samegame.qml @@ -1,54 +1,7 @@ -/**************************************************************************** -** -** 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$ -** -****************************************************************************/ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -import QtQuick 2.0 +import QtQuick //![2] import "samegame.js" as SameGame //![2] @@ -67,7 +20,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..50ed4cf815 100644 --- a/examples/quick/tutorials/samegame/samegame2/samegame2.qrc +++ b/examples/quick/tutorials/samegame/samegame2/samegame2.qrc @@ -1,8 +1,10 @@ <RCC> - <qresource prefix="/"> + <qresource prefix="/qt/qml/samegame"> <file>Button.qml</file> <file>Block.qml</file> <file>samegame.qml</file> <file>samegame.js</file> + <file>pics/background.jpg</file> + <file>pics/redStone.png</file> </qresource> </RCC> |