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: spriteimageelementtest
47 property string testtext: ""
52 source: "pics/squarefacesprite2.png"
55 to: {"silly": 1, "sad":0}
58 source: "pics/squarefacesprite.png"
61 to: {"happy": 1, "sad": 0}
64 source: "pics/squarefacesprite3.png"
67 to: {"evil": 0.5, "sad": 1, "cyclops" : 0}
70 source: "pics/squarefacesprite4.png"
73 to: {"love": 0.1, "boggled": 0.1, "cyclops" : 0.1}
76 source: "pics/squarefacesprite5.png"
79 to: {"sad": 1.0, "cyclops" : 0}
82 source: "pics/squarefacesprite6.png"
85 to: {"love": 0.1, "boggled": 0.1, "cyclops" : 0.1}
88 source: "pics/squarefacesprite7.png"
91 to: {"love": 0.1, "boggled": 0.1, "cyclops" : 0.1, "dying":0}
94 source: "pics/squarefacespriteX.png"
100 source: "pics/squarefacespriteXX.png"
107 anchors.horizontalCenter: parent.horizontalCenter
108 anchors.bottom: parent.bottom
112 SystemTestHelp { id: helpbubble; visible: statenum != 0
113 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 }
115 BugPanel { id: bugpanel }
118 State { name: "start"; when: statenum == 1
119 StateChangeScript { script: spriteimage.jumpTo("happy"); }
120 PropertyChanges { target: spriteimageelementtest
121 testtext: "This is a SpriteImage element. It should be animating currently."+
122 "It should alternate between winking and sticking out its tongue." }
124 State { name: "stochastic2"; when: statenum == 2
125 StateChangeScript { script: spriteimage.jumpTo("sad"); }
126 PropertyChanges { target: spriteimageelementtest
127 testtext: "The sprite should now be animating between frowning and being evil."+
128 "This should not be alternating, but mostly frowning with the occasional evil eyes."+
129 "After an evil eyes animation, it should return to frowning at least once." }
131 State { name: "stochastic3"; when: statenum == 3
132 StateChangeScript { script: spriteimage.jumpTo("cyclops"); }
133 PropertyChanges { target: spriteimageelementtest
134 testtext: "The sprite should now be animating fairly randomly between three animations where it does silly things with its eyes.\n"+
135 "Next the sprite will animate into a static 'dead' state."+
136 "When it does, it should first animate to and play through the 'big eyes' animation (if it is not currently playing that animation) before it enters the dying animation."}
138 State { name: "dead"; when: statenum == 4
139 PropertyChanges { target: spriteimage; goalState: "dead" }
140 PropertyChanges { target: spriteimageelementtest
141 testtext: "After a brief dying animation, the image should now be static.\n"+
142 "Advance to restart the test." }