1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the test suite of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
43 import QtQuick.Particles 2.0
48 property string testtext: ""
52 anchors.horizontalCenter: parent.horizontalCenter
53 anchors.bottom: parent.bottom
54 anchors.bottomMargin: 20
60 source: "pics/star.png"
66 property real magn: 0.1
70 velocity: TargetDirection {
71 targetX: particlesystem.width/2
72 targetY: particlesystem.height/2
73 proportionalMagnitude: true
74 magnitude: emitter.magn
75 magnitudeVariation: emitter.magn
77 shape: rectangleshapeelement
85 velocity: TargetDirection {
86 targetX: particlesystem.width/2
87 targetY: particlesystem.height/2
88 proportionalMagnitude: true
92 shape: lineshapeelement2
96 id: ellipseshapeelement
100 id: rectangleshapeelement
107 id: lineshapeelement2
112 source: "pics/logo-hollowed.png"
117 SystemTestHelp { id: helpbubble; visible: statenum != 0
118 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 }
120 BugPanel { id: bugpanel }
123 State { name: "start"; when: statenum == 1
124 PropertyChanges { target: shapeelementtest
125 testtext: "This is an Shape element, used by Emitter. There should be a rectangle "+
126 "shape emitting into its center.\n"+
127 "Next, let's change the shape to an ellipse." }
129 State { name: "ellipse"; when: statenum == 2
130 PropertyChanges { target: emitter; shape: ellipseshapeelement }
131 PropertyChanges { target: shapeelementtest
132 testtext: "The particles should now be emitted in a circular shape.\n"+
133 "Next, let's change the shape to a line." }
135 State { name: "line"; when: statenum == 3
136 PropertyChanges { target: emitter; shape: lineshapeelement; lifeSpan: 1000; emitRate: 200; }
137 PropertyChanges { target: emitter2; enabled: true }
138 PropertyChanges { target: shapeelementtest
139 testtext: "The particles should now be emitted from two lines, creating an X shape.\n"+
140 "Next, let's change the shape to an image." }
142 State { name: "enduring"; when: statenum == 4
143 PropertyChanges { target: emitter; shape: maskshapeelement; lifeSpan: 1000; emitRate: 1000; magn: 0 }
144 PropertyChanges { target: shapeelementtest
145 testtext: "The particles should now be sparkling, stationary within a 'Qt' text image.\n"+
146 "Advance to restart the test." }