Rewrite the canvas item's paint logic.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativefocusscope / data / forcefocus.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     width: 800; height: 600
5
6     FocusScope {
7         focus: true
8
9         FocusScope {
10             id: firstScope
11             objectName: "item0"
12             focus: true
13
14             Rectangle {
15                 height: 120; width: 420
16
17                 color: "transparent"
18                 border.width: 5; border.color: firstScope.activeFocus?"blue":"black"
19
20                 Rectangle {
21                     id: item1; objectName: "item1"
22                     x: 10; y: 10; width: 100; height: 100; color: "green"
23                     border.width: 5; border.color: activeFocus?"blue":"black"
24                     focus: true
25
26                     Rectangle {
27                         width: 50; height: 50; anchors.centerIn: parent
28                         color: parent.activeFocus?"red":"transparent"
29                     }
30                 }
31
32                 Rectangle {
33                     id: item2; objectName: "item2"
34                     x: 310; y: 10; width: 100; height: 100; color: "green"
35                     border.width: 5; border.color: activeFocus?"blue":"black"
36
37                     Rectangle {
38                         width: 50; height: 50; anchors.centerIn: parent
39                         color: parent.activeFocus?"red":"transparent"
40                     }
41                 }
42             }
43         }
44
45         FocusScope {
46             id: secondScope
47             objectName: "item3"
48
49             Rectangle {
50                 y: 160; height: 120; width: 420
51
52                 color: "transparent"
53                 border.width: 5; border.color: secondScope.activeFocus?"blue":"black"
54
55                 Rectangle {
56                     id: item4; objectName: "item4"
57                     x: 10; y: 10; width: 100; height: 100; color: "green"
58                     border.width: 5; border.color: activeFocus?"blue":"black"
59
60                     Rectangle {
61                         width: 50; height: 50; anchors.centerIn: parent
62                         color: parent.activeFocus?"red":"transparent"
63                     }
64                 }
65
66                 Rectangle {
67                     id: item5; objectName: "item5"
68                     x: 310; y: 10; width: 100; height: 100; color: "green"
69                     border.width: 5; border.color: activeFocus?"blue":"black"
70
71                     Rectangle {
72                         width: 50; height: 50; anchors.centerIn: parent
73                         color: parent.activeFocus?"red":"transparent"
74                     }
75                 }
76             }
77         }
78     }
79     Keys.onDigit4Pressed: item4.focus = true
80     Keys.onDigit5Pressed: item5.forceActiveFocus()
81 }