1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of QtUiTest.
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.
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.
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.
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.
40 ****************************************************************************/
47 property string testtext: ""
48 property int sidelength: 1500
53 color: "lightgray"; border.color: "gray"; radius: 5; clip: true; opacity: .7
54 height: 250; width: parent.width *.8
55 anchors.centerIn: parent
58 Keys.onLeftPressed: { if (statenum == 2) { advance(); } }
59 Keys.onRightPressed: { if (statenum == 1) { advance(); } }
60 Keys.onUpPressed: { if (statenum == 3) { advance(); } }
61 Keys.onDownPressed: { if (statenum == 4) { advance(); } }
63 if ((event.key == Qt.Key_Space) && (event.modifiers & Qt.ControlModifier) && (event.modifiers & Qt.AltModifier)) {
64 if (statenum == 5) { advance(); }
67 Rectangle { id: leftone; height: 50; width: 50; color: "green"; anchors{ left: parent.left; verticalCenter: parent.verticalCenter } }
68 Rectangle { id: rightone; height: 50; width: 50; color: "green"; anchors{ right: parent.right; verticalCenter: parent.verticalCenter } }
69 Rectangle { id: topone; height: 50; width: 50; color: "green"; anchors{ top: parent.top; horizontalCenter: parent.horizontalCenter } }
70 Rectangle { id: bottomone; height: 50; width: 50; color: "green"; anchors{ bottom: parent.bottom; horizontalCenter: parent.horizontalCenter } }
73 SystemTestHelp { id: helpbubble; visible: statenum != 0
74 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 }
76 BugPanel { id: bugpanel }
79 State { name: "start"; when: statenum == 1
80 PropertyChanges { target: helpbubble; showadvance: false }
81 PropertyChanges { target: keyselementtest
82 testtext: "This is a Keys element. At present there should be four squares\n"+
83 "Next, please press the right button on the keypad/board" }
85 State { name: "right"; when: statenum == 2
86 PropertyChanges { target: helpbubble; showadvance: false }
87 PropertyChanges { target: rightone; color: "orange" }
88 PropertyChanges { target: keyselementtest; testtext: "Good. Now press left." }
90 State { name: "left"; when: statenum == 3
91 PropertyChanges { target: helpbubble; showadvance: false }
92 PropertyChanges { target: leftone; color: "orange" }
93 PropertyChanges { target: keyselementtest; testtext: "Press up." }
95 State { name: "up"; when: statenum == 4
96 PropertyChanges { target: helpbubble; showadvance: false }
97 PropertyChanges { target: topone; color: "orange" }
98 PropertyChanges { target: keyselementtest; testtext: "And then press down" }
100 State { name: "down"; when: statenum == 5
101 PropertyChanges { target: helpbubble; showadvance: false }
102 PropertyChanges { target: bottomone; color: "orange" }
103 PropertyChanges { target: keyselementtest; testtext: "Excellent. Now hold Ctrl+Alt and press Space" }
105 State { name: "modifiers"; when: statenum == 6
106 PropertyChanges { target: helpbubble; showadvance: true }
107 PropertyChanges { target: keyselementbox; color: "orange" }
108 PropertyChanges { target: keyselementtest
109 testtext: "Test has completed\n"+
110 "Advance to restart the test." }