diff options
-rw-r--r-- | examples/quick/keyinteraction/CMakeLists.txt | 51 | ||||
-rw-r--r-- | examples/quick/keyinteraction/ContextMenu.qml (renamed from examples/quick/keyinteraction/focus/Core/ContextMenu.qml) | 4 | ||||
-rw-r--r-- | examples/quick/keyinteraction/GridMenu.qml (renamed from examples/quick/keyinteraction/focus/Core/GridMenu.qml) | 11 | ||||
-rw-r--r-- | examples/quick/keyinteraction/ListMenu.qml (renamed from examples/quick/keyinteraction/focus/Core/ListMenu.qml) | 6 | ||||
-rw-r--r-- | examples/quick/keyinteraction/ListViewDelegate.qml (renamed from examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml) | 13 | ||||
-rw-r--r-- | examples/quick/keyinteraction/TabMenu.qml (renamed from examples/quick/keyinteraction/focus/Core/TabMenu.qml) | 11 | ||||
-rw-r--r-- | examples/quick/keyinteraction/focus.qml (renamed from examples/quick/keyinteraction/focus/focus.qml) | 44 | ||||
-rw-r--r-- | examples/quick/keyinteraction/images/arrow.png (renamed from examples/quick/keyinteraction/focus/Core/images/arrow.png) | bin | 411 -> 411 bytes | |||
-rw-r--r-- | examples/quick/keyinteraction/images/qt-logo.png (renamed from examples/quick/keyinteraction/focus/Core/images/qt-logo.png) | bin | 5149 -> 5149 bytes | |||
-rw-r--r-- | examples/quick/keyinteraction/keyinteraction.qml | 6 | ||||
-rw-r--r-- | examples/quick/keyinteraction/keyinteraction.qrc | 16 |
11 files changed, 86 insertions, 76 deletions
diff --git a/examples/quick/keyinteraction/CMakeLists.txt b/examples/quick/keyinteraction/CMakeLists.txt index ffb8c8924a..e338c11024 100644 --- a/examples/quick/keyinteraction/CMakeLists.txt +++ b/examples/quick/keyinteraction/CMakeLists.txt @@ -1,13 +1,9 @@ -# Generated from keyinteraction.pro. - cmake_minimum_required(VERSION 3.16) project(keyinteraction LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) set(INSTALL_EXAMPLESDIR "examples") @@ -15,47 +11,36 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/keyinteraction") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Core Gui Quick Qml) -qt_add_executable(keyinteraction +qt_add_executable(keyinteractionexample WIN32 MACOSX_BUNDLE main.cpp ) -set_target_properties(keyinteraction PROPERTIES - WIN32_EXECUTABLE TRUE - MACOSX_BUNDLE TRUE -) -target_link_libraries(keyinteraction PUBLIC +target_link_libraries(keyinteractionexample PRIVATE Qt::Core Qt::Gui Qt::Qml Qt::Quick ) - # Resources: -set(keyinteraction_resource_files - "focus/Core/ContextMenu.qml" - "focus/Core/GridMenu.qml" - "focus/Core/ListMenu.qml" - "focus/Core/ListViewDelegate.qml" - "focus/Core/TabMenu.qml" - "focus/Core/images/arrow.png" - "focus/Core/images/qt-logo.png" - "focus/focus.qml" - "keyinteraction.qml" -) - -qt6_add_resources(keyinteraction "keyinteraction" - PREFIX - "/keyinteraction" - FILES - ${keyinteraction_resource_files} +qt_add_qml_module(keyinteractionexample + URI keyinteraction + VERSION 1.0 + QML_FILES + "ContextMenu.qml" + "GridMenu.qml" + "ListMenu.qml" + "ListViewDelegate.qml" + "TabMenu.qml" + "focus.qml" + "keyinteraction.qml" + RESOURCES + "images/arrow.png" + "images/qt-logo.png" ) -install(TARGETS keyinteraction +install(TARGETS keyinteractionexample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" diff --git a/examples/quick/keyinteraction/focus/Core/ContextMenu.qml b/examples/quick/keyinteraction/ContextMenu.qml index 31b5e1b83d..66dcdf3fe8 100644 --- a/examples/quick/keyinteraction/focus/Core/ContextMenu.qml +++ b/examples/quick/keyinteraction/ContextMenu.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick FocusScope { id: container diff --git a/examples/quick/keyinteraction/focus/Core/GridMenu.qml b/examples/quick/keyinteraction/GridMenu.qml index 78d6654957..4b05785e1d 100644 --- a/examples/quick/keyinteraction/focus/Core/GridMenu.qml +++ b/examples/quick/keyinteraction/GridMenu.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick FocusScope { id: menu @@ -105,7 +105,12 @@ FocusScope { states: State { name: "active"; when: container.activeFocus - PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } + PropertyChanges { + content { + color: "#FCFFF5" + scale: 1.1 + } + } } transitions: Transition { diff --git a/examples/quick/keyinteraction/focus/Core/ListMenu.qml b/examples/quick/keyinteraction/ListMenu.qml index 694ae3cac6..97a37a714b 100644 --- a/examples/quick/keyinteraction/focus/Core/ListMenu.qml +++ b/examples/quick/keyinteraction/ListMenu.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,8 +48,8 @@ ** ****************************************************************************/ -import QtQml 2.1 -import QtQuick 2.1 +import QtQml +import QtQuick FocusScope { id: menu diff --git a/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/quick/keyinteraction/ListViewDelegate.qml index 5a2957eab0..9fe4949282 100644 --- a/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml +++ b/examples/quick/keyinteraction/ListViewDelegate.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick Item { id: container @@ -87,8 +87,13 @@ Item { states: State { name: "active"; when: container.activeFocus - PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } - PropertyChanges { target: label; font.pixelSize: 16 } + PropertyChanges { + content { + color: "#FCFFF5" + scale: 1.1 + } + label.font.pixelSize: 16 + } } transitions: Transition { diff --git a/examples/quick/keyinteraction/focus/Core/TabMenu.qml b/examples/quick/keyinteraction/TabMenu.qml index 11b3d005c3..7aa70a7dcb 100644 --- a/examples/quick/keyinteraction/focus/Core/TabMenu.qml +++ b/examples/quick/keyinteraction/TabMenu.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,7 +48,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick FocusScope { id: menu @@ -100,7 +100,12 @@ FocusScope { states: State { name: "active"; when: container.activeFocus - PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 } + PropertyChanges { + content { + color: "#FCFFF5" + scale: 1.1 + } + } } transitions: Transition { diff --git a/examples/quick/keyinteraction/focus/focus.qml b/examples/quick/keyinteraction/focus.qml index 9db9ab48bc..1eef9b9981 100644 --- a/examples/quick/keyinteraction/focus/focus.qml +++ b/examples/quick/keyinteraction/focus.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,9 +48,8 @@ ** ****************************************************************************/ -import QtQml 2.1 -import QtQuick 2.1 -import "Core" +import QtQml +import QtQuick Rectangle { id: window @@ -119,23 +118,29 @@ Rectangle { states: [ State { name: "showTabViews" - PropertyChanges { target: tabMenu; y: 160 } - PropertyChanges { target: gridMenu; y: 320 } - PropertyChanges { target: listMenu; y: 640 } + PropertyChanges { + tabMenu.y: 160 + gridMenu.y: 320 + listMenu.y: 640 + } }, State { name: "showGridViews" - PropertyChanges { target: tabMenu; y: 0 } - PropertyChanges { target: gridMenu; y: 160 } - PropertyChanges { target: listMenu; y: 480 } + PropertyChanges { + tabMenu.y: 0 + gridMenu.y: 160 + listMenu.y: 480 + } }, State { name: "showListViews" - PropertyChanges { target: tabMenu; y: -160 } - PropertyChanges { target: gridMenu; y: 0 } - PropertyChanges { target: listMenu; y: 320 } + PropertyChanges { + tabMenu.y: -160 + gridMenu.y: 0 + listMenu.y: 320 + } } ] @@ -145,7 +150,7 @@ Rectangle { } Image { - source: "Core/images/arrow.png" + source: "images/arrow.png" rotation: 90 anchors.verticalCenter: parent.verticalCenter @@ -166,9 +171,14 @@ Rectangle { states: State { name: "contextMenuOpen" when: !mainView.activeFocus - PropertyChanges { target: contextMenu; x: 0; open: true } - PropertyChanges { target: mainView; x: 130 } - PropertyChanges { target: shade; opacity: 0.25 } + PropertyChanges { + contextMenu { + x: 0 + open: true + } + mainView.x: 130 + shade.opacity: 0.25 + } } transitions: Transition { diff --git a/examples/quick/keyinteraction/focus/Core/images/arrow.png b/examples/quick/keyinteraction/images/arrow.png Binary files differindex 20ee200f5f..20ee200f5f 100644 --- a/examples/quick/keyinteraction/focus/Core/images/arrow.png +++ b/examples/quick/keyinteraction/images/arrow.png diff --git a/examples/quick/keyinteraction/focus/Core/images/qt-logo.png b/examples/quick/keyinteraction/images/qt-logo.png Binary files differindex 14ddf2a028..14ddf2a028 100644 --- a/examples/quick/keyinteraction/focus/Core/images/qt-logo.png +++ b/examples/quick/keyinteraction/images/qt-logo.png diff --git a/examples/quick/keyinteraction/keyinteraction.qml b/examples/quick/keyinteraction/keyinteraction.qml index 7fa3078803..c79ba7217e 100644 --- a/examples/quick/keyinteraction/keyinteraction.qml +++ b/examples/quick/keyinteraction/keyinteraction.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the examples of the Qt Toolkit. @@ -48,10 +48,10 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick Loader {//Just loader, since there's only one. - source: "focus/focus.qml" + source: "focus.qml" focus: true // Exception to the standard sizing, because this is primarily a desktop // example and it benefits from being able to see everything at once. diff --git a/examples/quick/keyinteraction/keyinteraction.qrc b/examples/quick/keyinteraction/keyinteraction.qrc index c719654835..8738ef9826 100644 --- a/examples/quick/keyinteraction/keyinteraction.qrc +++ b/examples/quick/keyinteraction/keyinteraction.qrc @@ -1,13 +1,13 @@ <RCC> <qresource prefix="/keyinteraction"> <file>keyinteraction.qml</file> - <file>focus/focus.qml</file> - <file>focus/Core/images/arrow.png</file> - <file>focus/Core/images/qt-logo.png</file> - <file>focus/Core/ContextMenu.qml</file> - <file>focus/Core/GridMenu.qml</file> - <file>focus/Core/ListMenu.qml</file> - <file>focus/Core/ListViewDelegate.qml</file> - <file>focus/Core/TabMenu.qml</file> + <file>focus.qml</file> + <file>ContextMenu.qml</file> + <file>GridMenu.qml</file> + <file>ListMenu.qml</file> + <file>ListViewDelegate.qml</file> + <file>TabMenu.qml</file> + <file>images/arrow.png</file> + <file>images/qt-logo.png</file> </qresource> </RCC> |