aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickaccessible/data
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-02-16 14:43:03 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-24 04:51:31 +0100
commitb855240b782395f94315f43ea3e7e182299fac48 (patch)
treebc594c04449be8cd14cd0ab0bb72dafc2be0ffb2 /tests/auto/quick/qquickaccessible/data
parent6a42a6e0a9a1abdda0d07a5a20b4ac7e45348684 (diff)
Rename QDeclarative symbols to QQuick and QQml
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickaccessible/data')
-rw-r--r--tests/auto/quick/qquickaccessible/data/checkbuttons.qml47
-rw-r--r--tests/auto/quick/qquickaccessible/data/hittest.qml176
-rw-r--r--tests/auto/quick/qquickaccessible/data/pushbutton.qml15
-rw-r--r--tests/auto/quick/qquickaccessible/data/statictext.qml25
-rw-r--r--tests/auto/quick/qquickaccessible/data/widgets/TextRect.qml26
5 files changed, 289 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickaccessible/data/checkbuttons.qml b/tests/auto/quick/qquickaccessible/data/checkbuttons.qml
new file mode 100644
index 0000000000..22cdad1377
--- /dev/null
+++ b/tests/auto/quick/qquickaccessible/data/checkbuttons.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.0
+
+Item {
+ width: 400
+ height: 400
+
+ // button, not checkable
+ Rectangle {
+ y: 20
+ width: 100; height: 20
+ Accessible.role : Accessible.Button
+ }
+
+ // button, checkable, not checked
+ Rectangle {
+ y: 40
+ width: 100; height: 20
+ Accessible.role : Accessible.Button
+ property bool checkable: true
+ property bool checked: false
+ }
+
+ // button, checkable, checked
+ Rectangle {
+ y: 60
+ width: 100; height: 20
+ Accessible.role : Accessible.Button
+ property bool checkable: true
+ property bool checked: true
+ }
+
+ // check box, checked
+ Rectangle {
+ y: 80
+ width: 100; height: 20
+ Accessible.role : Accessible.CheckBox
+ property bool checked: true
+ }
+ // check box, not checked
+ Rectangle {
+ y: 100
+ width: 100; height: 20
+ Accessible.role : Accessible.CheckBox
+ property bool checked: false
+ }
+}
+
diff --git a/tests/auto/quick/qquickaccessible/data/hittest.qml b/tests/auto/quick/qquickaccessible/data/hittest.qml
new file mode 100644
index 0000000000..e8003e648a
--- /dev/null
+++ b/tests/auto/quick/qquickaccessible/data/hittest.qml
@@ -0,0 +1,176 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+import QtQuick 2.0
+import "widgets"
+
+Rectangle {
+ id: page
+ width: 640
+ height: 480
+ color: "white"
+ Rectangle {
+ id: header
+ color: "#c0c0c0"
+ height: usage.height + chkClip.height
+ anchors.left: parent.left
+ anchors.right: parent.right
+ Text {
+ id: usage
+ text: "Use an a11y inspect tool to see if all visible rectangles can be found with hit testing."
+ }
+ Rectangle {
+ id: chkClip
+ property bool checked: true
+
+ color: (checked ? "#f0f0f0" : "#c0c0c0")
+ height: label.height
+ width: label.width
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: chkClip.checked = !chkClip.checked
+ }
+ Text {
+ id: label
+ text: "Click here to toggle clipping"
+ }
+ }
+ }
+ TextRect {
+ clip: chkClip.checked
+ z: 2
+ id: rect1
+ text: "rect1"
+ width: 100
+ height: 100
+ color: "#ffc0c0"
+ anchors.top: header.bottom
+ TextRect {
+ id: rect10
+ text: "rect10"
+ width: 100
+ height: 100
+ x: 50
+ y: 50
+ color: "#ffa0a0"
+ TextRect {
+ id: rect100
+ text: "rect100"
+ width: 100
+ height: 100
+ x: 80
+ y: 80
+ color: "#ff8080"
+ }
+ TextRect {
+ id: rect101
+ text: "rect101"
+ x: 100
+ y: 70
+ z: 3
+ width: 100
+ height: 100
+ color: "#e06060"
+ }
+ TextRect {
+ id: rect102
+ text: "rect102"
+ width: 100
+ height: 100
+ x: 150
+ y: 60
+ color: "#c04040"
+ }
+ }
+ }
+
+ TextRect {
+ x: 0
+ y: 50
+ id: rect2
+ text: "rect2"
+ width: 100
+ height: 100
+ color: "#c0c0ff"
+ TextRect {
+ id: rect20
+ text: "rect20"
+ width: 100
+ height: 100
+ x: 50
+ y: 50
+ color: "#a0a0ff"
+ TextRect {
+ id: rect200
+ text: "rect200"
+ width: 100
+ height: 100
+ x: 80
+ y: 80
+ color: "#8080ff"
+ }
+ TextRect {
+ id: rect201
+ text: "rect201"
+ x: 100
+ y: 70
+ z: 100
+ width: 100
+ height: 100
+ color: "#6060e0"
+ }
+ TextRect {
+ id: rect202
+ text: "rect202"
+ width: 100
+ height: 100
+ x: 150
+ y: 60
+ color: "#4040c0"
+ }
+ }
+ }
+
+}
diff --git a/tests/auto/quick/qquickaccessible/data/pushbutton.qml b/tests/auto/quick/qquickaccessible/data/pushbutton.qml
new file mode 100644
index 0000000000..df19231703
--- /dev/null
+++ b/tests/auto/quick/qquickaccessible/data/pushbutton.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+
+Rectangle {
+ Accessible.role : Accessible.Button
+ property string text : "test"
+
+ Text {
+ anchors.fill : parent
+ text : parent.text
+ }
+
+ MouseArea {
+ anchors.fill : parent
+ }
+}
diff --git a/tests/auto/quick/qquickaccessible/data/statictext.qml b/tests/auto/quick/qquickaccessible/data/statictext.qml
new file mode 100644
index 0000000000..a0821cfc4d
--- /dev/null
+++ b/tests/auto/quick/qquickaccessible/data/statictext.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+
+Item {
+ width: 400
+ height: 400
+
+ Text {
+ x: 100
+ y: 20
+ width: 200
+ height: 50
+ text : "Hello Accessibility"
+ }
+
+ Text {
+ x: 100
+ y: 40
+ width: 100
+ height: 40
+ text : "Hello 2"
+ Accessible.role: Accessible.StaticText
+ Accessible.name: "The Hello 2 accessible text"
+ Accessible.description: "A text description"
+ }
+}
diff --git a/tests/auto/quick/qquickaccessible/data/widgets/TextRect.qml b/tests/auto/quick/qquickaccessible/data/widgets/TextRect.qml
new file mode 100644
index 0000000000..937686974b
--- /dev/null
+++ b/tests/auto/quick/qquickaccessible/data/widgets/TextRect.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: button
+
+ property alias text : buttonText.text
+ Accessible.name: text
+ Accessible.description: "This button does " + text
+ Accessible.role: Accessible.Client
+
+ signal clicked
+
+ width: 40
+ height: 40
+ border.width: 2
+ border.color: "black";
+
+ Text {
+ id: buttonText
+ text: "TextRect"
+ anchors.centerIn: parent
+ font.pixelSize: parent.height * .1
+ style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true
+ }
+
+}