aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/keyinteraction/focus.qml
diff options
context:
space:
mode:
authorBumjoon Park <bumjoon.park@qt.io>2023-03-23 17:11:12 +0900
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-27 10:34:58 +0000
commit3238e18d6b0dc45d2e765fb0b93da5cbf3f396ec (patch)
treee9ea5df2ce1bf5bfa6177a081bf6423069a70013 /examples/quick/keyinteraction/focus.qml
parent26e86ee9ea26c9031d51d17448b9035a27fa9208 (diff)
Keyinteraction example: Update by coding conventions from official docv6.5.06.5.0
- string are translated. - JS statements no longer end with semi-colon. - Fix qmllint warning. Change-Id: I83f2b702c9bb9f02f86728e2277297272cd75251 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 023849fce46d25edc41db7b7c9e275cb0de5c189) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/quick/keyinteraction/focus.qml')
-rw-r--r--examples/quick/keyinteraction/focus.qml40
1 files changed, 30 insertions, 10 deletions
diff --git a/examples/quick/keyinteraction/focus.qml b/examples/quick/keyinteraction/focus.qml
index 385f35d05b..42edcb5f01 100644
--- a/examples/quick/keyinteraction/focus.qml
+++ b/examples/quick/keyinteraction/focus.qml
@@ -7,18 +7,23 @@ import QtQuick
Rectangle {
id: window
- width: 800; height: 640
+ width: 800
+ height: 640
color: "#3E606F"
FocusScope {
id: mainView
- width: parent.width; height: parent.height
+ width: parent.width
+ height: parent.height
focus: true
TabMenu {
id: tabMenu
- y: 160; width: parent.width; height: 160
+
+ y: 160
+ width: parent.width
+ height: 160
keyUpTarget: listMenu
keyDownTarget: gridMenu
@@ -34,7 +39,10 @@ Rectangle {
GridMenu {
id: gridMenu
- y: 320; width: parent.width; height: 320
+
+ y: 320
+ width: parent.width
+ height: 320
activeFocusOnTab: true
keyUpTarget: tabMenu
@@ -49,7 +57,10 @@ Rectangle {
ListMenu {
id: listMenu
- y: 640; width: parent.width; height: 320
+
+ y: 640
+ width: parent.width
+ height: 320
activeFocusOnTab: true
keyUpTarget: gridMenu
@@ -72,7 +83,7 @@ Rectangle {
State {
name: "showTabViews"
PropertyChanges {
- tabMenu.y: 160
+ tabMenu.y: 160
gridMenu.y: 320
listMenu.y: 640
}
@@ -81,7 +92,7 @@ Rectangle {
State {
name: "showGridViews"
PropertyChanges {
- tabMenu.y: 0
+ tabMenu.y: 0
gridMenu.y: 160
listMenu.y: 480
}
@@ -98,7 +109,11 @@ Rectangle {
]
transitions: Transition {
- NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint }
+ NumberAnimation {
+ properties: "y"
+ duration: 600
+ easing.type: Easing.OutQuint
+ }
}
}
@@ -108,7 +123,8 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
MouseArea {
- anchors.fill: parent; anchors.margins: -10
+ anchors.fill: parent
+ anchors.margins: -10
onClicked: contextMenu.focus = true
}
}
@@ -135,6 +151,10 @@ Rectangle {
}
transitions: Transition {
- NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint }
+ NumberAnimation {
+ properties: "x,opacity"
+ duration: 600
+ easing.type: Easing.OutQuint
+ }
}
}