1 /****************************************************************************
3 ** Copyright (C) 2012 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 the test suite of the Qt Toolkit.
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 ****************************************************************************/
45 id: mouseareaelementtest
47 property string testtext: ""
48 property int sidelength: 1500
52 id: mouseareaelementbox
53 color: "lightgray"; border.color: "gray"; radius: 5; clip: true; opacity: .7; height: 300; width: 300
54 anchors.centerIn: parent
62 height: 50; width: 50; color: metopleft.containsMouse ? "green" : "blue"
63 anchors { top: mouseareaelementbox.top; left: mouseareaelementbox.left; margins: 5 }
68 onContainsMouseChanged: { if (containsMouse && statenum == 1) { advance(); } }
73 height: 50; width: 50; color: metopright.containsMouse ? "green" : "blue"
74 anchors { top: mouseareaelementbox.top; right: mouseareaelementbox.right; topMargin: 5; rightMargin: 5 }
79 onContainsMouseChanged: { if (containsMouse && statenum == 4) { advance(); } }
84 height: 50; width: 50; color: mebottomleft.containsMouse ? "green" : "blue"
85 anchors { bottom: mouseareaelementbox.bottom; left: mouseareaelementbox.left; bottomMargin: 5; leftMargin: 5 }
90 onContainsMouseChanged: { if (containsMouse && statenum == 3) { advance(); } }
95 height: 50; width: 50; color: mebottomright.containsMouse ? "green" : "blue"
96 anchors { bottom: mouseareaelementbox.bottom; right: mouseareaelementbox.right; bottomMargin: 5; rightMargin: 5 }
101 onContainsMouseChanged: { if (containsMouse && statenum == 2) { advance(); } }
106 height: 10; width: 10; radius: 5; x: mouseareaelement.mouseX; y: mouseareaelement.mouseY; color: "red"
111 SystemTestHelp { id: helpbubble; visible: statenum != 0
112 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 }
114 BugPanel { id: bugpanel }
117 State { name: "start"; when: statenum == 1
118 PropertyChanges { target: helpbubble; showadvance: false }
119 PropertyChanges { target: mouseareaelementtest
120 testtext: "This test contains a number of MouseArea elements. At present there should be four rectangles\n"+
121 "Next, move the pointer to the top left of the square" }
123 State { name: "topleft"; when: statenum == 2
124 PropertyChanges { target: helpbubble; showadvance: false }
125 PropertyChanges { target: topleft; color: "yellow" }
126 PropertyChanges { target: mouseareaelementtest; testtext: "Good. Now move it down to the bottom right." }
128 State { name: "bottomright"; when: statenum == 3
129 PropertyChanges { target: helpbubble; showadvance: false }
130 PropertyChanges { target: bottomright; color: "yellow" }
131 PropertyChanges { target: mouseareaelementtest; testtext: "To the bottom left." }
133 State { name: "bottomleft"; when: statenum == 4
134 PropertyChanges { target: helpbubble; showadvance: false }
135 PropertyChanges { target: bottomleft; color: "yellow" }
136 PropertyChanges { target: mouseareaelementtest; testtext: "Then to top right" }
138 State { name: "topright"; when: statenum == 5
139 PropertyChanges { target: helpbubble; showadvance: false }
140 PropertyChanges { target: topright; color: "yellow" }
141 PropertyChanges { target: mouseareaelementtest
142 testtext: "Excellent.\n"+
143 "Modifiers test not yet defined." }
145 State { name: "modifiers"; when: statenum == 6
146 PropertyChanges { target: helpbubble; showadvance: true }
147 PropertyChanges { target: mouseareaelementtest
148 testtext: "Test has completed\n"+
149 "Advance to restart the test." }