diff options
Diffstat (limited to 'examples/declarative/focusscope/test.qml')
-rw-r--r-- | examples/declarative/focusscope/test.qml | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/declarative/focusscope/test.qml b/examples/declarative/focusscope/test.qml index 77ffb84..ab5a143 100644 --- a/examples/declarative/focusscope/test.qml +++ b/examples/declarative/focusscope/test.qml @@ -8,28 +8,28 @@ Rectangle { Keys.onDigit9Pressed: print("Error - Root") FocusScope { - id: MyScope + id: myScope focus: true Keys.onDigit9Pressed: print("Error - FocusScope") - + Rectangle { height: 120 width: 420 color: "transparent" border.width: 5 - border.color: MyScope.wantsFocus?"blue":"black" + border.color: myScope.wantsFocus?"blue":"black" Rectangle { - id: Item1 - x: 10; y: 10 + id: item1 + x: 10; y: 10 width: 100; height: 100; color: "green" border.width: 5 border.color: wantsFocus?"blue":"black" Keys.onDigit9Pressed: print("Top Left"); - KeyNavigation.right: Item2 - focus: true + KeyNavigation.right: item2 + focus: true Rectangle { width: 50; height: 50; anchors.centerIn: parent @@ -38,12 +38,12 @@ Rectangle { } Rectangle { - id: Item2 + id: item2 x: 310; y: 10 width: 100; height: 100; color: "green" border.width: 5 border.color: wantsFocus?"blue":"black" - KeyNavigation.left: Item1 + KeyNavigation.left: item1 Keys.onDigit9Pressed: print("Top Right"); Rectangle { @@ -52,20 +52,20 @@ Rectangle { } } } - KeyNavigation.down: Item3 + KeyNavigation.down: item3 } Text { x:100; y:170; text: "Blue border indicates scoped focus\nBlack border indicates NOT scoped focus\nRed box indicates active focus\nUse arrow keys to navigate\nPress \"9\" to print currently focused item" } Rectangle { - id: Item3 + id: item3 x: 10; y: 300 width: 100; height: 100; color: "green" border.width: 5 border.color: wantsFocus?"blue":"black" Keys.onDigit9Pressed: print("Bottom Left"); - KeyNavigation.up: MyScope + KeyNavigation.up: myScope Rectangle { width: 50; height: 50; anchors.centerIn: parent |