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
46 id: directionelementtest
48 property string testtext: ""
60 height: 0; width: 0; radius: 20
61 anchors.centerIn: parent
62 Behavior on height { NumberAnimation { duration: 500; easing.type: Easing.OutBounce } }
63 Behavior on width { NumberAnimation { duration: 500; easing.type: Easing.OutBounce } }
68 source: "pics/star.png"
70 entryEffect: ImageParticle.None
74 anchors.bottom: parent.bottom
75 anchors.bottomMargin: 5
76 anchors.horizontalCenter: parent.horizontalCenter
80 speed: angledirectionelement
81 AngleDirection { id: angledirectionelement; angle: -75; angleVariation: 5; magnitude: 150 }
82 TargetDirection { id: targetdirectionelement; targetItem: targetbox; targetVariation: 10; magnitude: 150 }
83 PointDirection { id: pointdirectionelement; y: -100; xVariation: 10; yVariation: 10; }
84 PointDirection { id: pointdirectionelementdownward; y: 200 }
86 id: cumulativedirectionelement
87 PointDirection { y: -200 }
88 AngleDirection { angle: 270; angleVariation: 45; magnitude: 100; magnitudeVariation: 10; }
93 SystemTestHelp { id: helpbubble; visible: statenum != 0
94 anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 }
96 BugPanel { id: bugpanel }
99 State { name: "start"; when: statenum == 1
100 PropertyChanges { target: directionelementtest
101 testtext: "This is an Emitter with the direction set by an AngleDirection.\n"+
102 "The particles should be firing at a -75 degree (to the top right) .\n"+
103 "Next, let's change the Emitter to target an item." }
105 State { name: "ontarget"; when: statenum == 2
106 PropertyChanges { target: emitter; speed: targetdirectionelement }
107 PropertyChanges { target: targeticon; height: 50; width: 50 }
108 PropertyChanges { target: directionelementtest
109 testtext: "The particles should be directed at the rectangle.\n"+
110 "Next, let's set an arbritary point to direct the particles to." }
112 State { name: "onpoint"; when: statenum == 3
113 PropertyChanges { target: emitter; speed: pointdirectionelement }
114 PropertyChanges { target: directionelementtest
115 testtext: "The particles should be directed upwards with a small amount of spread.\n"+
116 "Next, let's create a fountain with CumulativeDirection and a downward PointDirection" }
118 State { name: "cumulative"; when: statenum == 4
119 PropertyChanges { target: emitter; emitRate: 200; speed: cumulativedirectionelement
120 acceleration: pointdirectionelementdownward }
121 PropertyChanges { target: imgparticle; color: "aqua"; colorVariation: .2 }
122 PropertyChanges { target: directionelementtest
123 testtext: "The particles should be flowing upwards and falling in a fountain effect.\n"+
124 "Advance to restart the test." }