e6ce8b1882511bf57b9f7f29c30a1ea4aa703c9f
[profile/ivi/qtdeclarative.git] / tests / auto / qtquick2 / qquickaccessible / data / hittest.qml
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
6 **
7 ** This file is part of the QtDeclarative module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 **
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 **
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
29 **
30 ** Other Usage
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42
43 import QtQuick 2.0
44 import "widgets"
45
46 Rectangle {
47     id: page
48     width: 640
49     height: 480
50     color: "white"
51     Rectangle {
52         id: header
53         color: "#c0c0c0"
54         height: usage.height + chkClip.height
55         anchors.left: parent.left
56         anchors.right: parent.right
57         Text {
58             id: usage
59             text: "Use an a11y inspect tool to see if all visible rectangles can be found with hit testing."
60         }
61         Rectangle {
62             id: chkClip
63             property bool checked: true
64
65             color: (checked ? "#f0f0f0" : "#c0c0c0")
66             height: label.height
67             width: label.width
68             anchors.left: parent.left
69             anchors.bottom: parent.bottom
70
71             MouseArea {
72                 anchors.fill: parent
73                 onClicked: chkClip.checked = !chkClip.checked
74             }
75             Text {
76                 id: label
77                 text: "Click here to toggle clipping"
78             }
79         }
80     }
81     TextRect {
82         clip: chkClip.checked
83         z: 2
84         id: rect1
85         text: "rect1"
86         width: 100
87         height: 100
88         color: "#ffc0c0"
89         anchors.top: header.bottom
90         TextRect {
91             id: rect10
92             text: "rect10"
93             width: 100
94             height: 100
95             x: 50
96             y: 50
97             color: "#ffa0a0"
98             TextRect {
99                 id: rect100
100                 text: "rect100"
101                 width: 100
102                 height: 100
103                 x: 80
104                 y: 80
105                 color: "#ff8080"
106             }
107             TextRect {
108                 id: rect101
109                 text: "rect101"
110                 x: 100
111                 y: 70
112                 z: 3
113                 width: 100
114                 height: 100
115                 color: "#e06060"
116             }
117             TextRect {
118                 id: rect102
119                 text: "rect102"
120                 width: 100
121                 height: 100
122                 x: 150
123                 y: 60
124                 color: "#c04040"
125             }
126         }
127     }
128
129     TextRect {
130         x: 0
131         y: 50
132         id: rect2
133         text: "rect2"
134         width: 100
135         height: 100
136         color: "#c0c0ff"
137         TextRect {
138             id: rect20
139             text: "rect20"
140             width: 100
141             height: 100
142             x: 50
143             y: 50
144             color: "#a0a0ff"
145             TextRect {
146                 id: rect200
147                 text: "rect200"
148                 width: 100
149                 height: 100
150                 x: 80
151                 y: 80
152                 color: "#8080ff"
153             }
154             TextRect {
155                 id: rect201
156                 text: "rect201"
157                 x: 100
158                 y: 70
159                 z: 100
160                 width: 100
161                 height: 100
162                 color: "#6060e0"
163             }
164             TextRect {
165                 id: rect202
166                 text: "rect202"
167                 width: 100
168                 height: 100
169                 x: 150
170                 y: 60
171                 color: "#4040c0"
172             }
173         }
174     }
175
176 }