From: Damian Jansen Date: Mon, 3 Oct 2011 02:53:17 +0000 (+1000) Subject: Add Particles basic acceptance manual tests. X-Git-Tag: qt-v5.0.0-alpha1~1454 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fac7ee6085fe0ebd0dcfd16407b4bc99faaef07b;p=profile%2Fivi%2Fqtdeclarative.git Add Particles basic acceptance manual tests. Change-Id: I9be3f3257d74e6a3535f8137083e5dad31965c87 Reviewed-on: http://codereview.qt-project.org/5906 Reviewed-by: Qt Sanity Bot Reviewed-by: Alan Alpert --- diff --git a/tests/system/sys_elements.qtt b/tests/system/sys_elements.qtt index c8c8b19..296dd83 100644 --- a/tests/system/sys_elements.qtt +++ b/tests/system/sys_elements.qtt @@ -40,373 +40,82 @@ ****************************************************************************/ //TESTED_COMPONENT=qtdeclarative -var adv = "Press the Advance button"; -testcase = { - - rectangle: function() - { - // Test Meta-data - testApplication = "Elements: Rectangle"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the rectangle element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Rectangle list item | Verify that the Rectangle displayed in the center is small, blue, with a thin red angular border | - | '+adv+' | The rectangle should now be twice the size as the previous step | - | '+adv+' | The rectangle should now have rounded corners | - | '+adv+' | The rectangle color should have shifted to green | - | '+adv+' | The rectangle border should have increased significantly | - | '+adv+' | The rectangle border should have now be small, blue, with a thin red angular border |')); - }, - - image: function() - { - // Test Meta-data - testApplication = "Elements: Image"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Image element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Image list item | Verify it shows the Nokia logo, large and still slightly stretched | - | '+adv+' | Verify it shows the Nokia logo normally, longer horizontally | - | '+adv+' | Verify it shows the Nokia logo with the sides cut | - | '+adv+' | Verify it shows the Nokia logo repeated both horizontally and vertically | - | '+adv+' | Verify it shows the Nokia logo repeated vertically only | - | '+adv+' | Verify it shows the Nokia logo repeated horizontally only |')); - }, - - animatedimage: function() - { - // Test Meta-data - testApplication = "Elements: AnimatedImage"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the AnimatedImage element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the AnimatedImage list item | Verify it shows a small animated icon, but slightly stretched. | - | '+adv+' | Verify it shows the animated icon, large and still slightly stretched | - | '+adv+' | Verify it shows the animated icon normally, square | - | '+adv+' | Verify it shows the animated icon with the sides cut | - | '+adv+' | Verify it shows the animated icon repeated both horizontally and vertically | - | '+adv+' | Verify it shows the animated icon repeated vertically only | - | '+adv+' | Verify it shows the animated icon repeated horizontally only |')); - }, - - borderimage: function() - { - // Test Meta-data - testApplication = "Elements: BorderImage"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the BorderImage element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the BorderImage list item | Verify it shows a small framed image | - | '+adv+' | Verify it shows the frame, large and each side stretched | - | '+adv+' | Verify it shows the frame with slightly off centere sides | - | '+adv+' | Verify it shows the frame with uniformly repeated sides |')); - }, - - systempalette: function() - { - // Test Meta-data - testApplication = "Elements: SystemPalette"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the SystemPalette element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the SystemPalette list item | Verify it shows a mockup of an application | - | '+adv+' | Verify it shows the colors similar to the system it is running on | - | '+adv+' | Verify it shows the new coloring |')); - }, - - text: function() - { - // Test Meta-data - testApplication = "Elements: Text"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Text element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Text list item | Verify it shows a Hello message | - | '+adv+' | Verify it shows the text increased to twice the previous size, and wrapped to two lines | - | '+adv+' | Verify it shows the text smoothly changed color to blue over a second | - | '+adv+' | Verify it shows the text as blue, bolded and in italic | - | '+adv+' | Verify it shows the text as alternating between green and black |')); - }, - - textinput: function() - { - // Test Meta-data - testApplication = "Elements: TextInput"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the TextInput element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the TextInput list item | Verify it shows two fields, the green one displaying a Hello message | - | '+adv+' | Verify it selects the last word - TextInput - of the green field | - | '+adv+' | Verify it animates a copy of the selected text to the gray field | - | '+adv+' | Verify it shows the text as asterisks |')); - }, - - textedit: function() - { - // Test Meta-data - testApplication = "Elements: TextEdit"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the TextEdit element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the TextEdit list item | Verify it shows two large fields | - | '+adv+' | Verify it selects the last word - TextEdit - of the green field | - | '+adv+' | Verify it animates a copy of the selected text to the gray field | - | '+adv+' | Verify it shows more text, with the end disappearing past the right side of the green field | - | '+adv+' | Verify it shows the full text, properly wrapped within the green field |')); - }, - - fontloader: function() - { - // Test Meta-data - testApplication = "Elements: FontLoader"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the FontLoader element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the FontLoader list item | Verify it shows a box with a named font in the center | - | '+adv+' | Verify the font has changed along with the named font text | - | '+adv+' | Verify the font is changing every half second, for at least a few different fonts, without error | - | '+adv+' | Verify the font has changed to a Neon Lights font | - | '+adv+' | Verify the font has reverted to a named system font |')); - }, - - flipable: function() { - // Test Meta-data - testApplication = "Elements: Flipable"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Flipable element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Flipable list item | Verify it shows a large green rectangle | - | '+adv+' | Verify it slowly spins horizontally to show a red rectangle on the back | - | '+adv+' | Verify it again slowly spins horizontally to show a green rectangle on the front | - | '+adv+' | Verify it again slowly spins vertically to show a red rectangle on the back | - | '+adv+' | Verify it again slowly spins horizontally to show a green rectangle on the front |')); - }, - - intvalidator: function() - { - // Test Meta-data - testApplication = "Elements: IntValidator"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the IntValidator element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the IntValidator list item | Verify it shows a green field with the number 0. The upper and lower bounds are 30 and -50 | - | '+adv+' | Verify the number is now -80, and the field is now red | - | '+adv+' | Verify the number is now -50, and the field is now green | - | '+adv+' | Verify the number is now 35, and the field is now red | - | '+adv+' | Verify the top value has changed to 35, and the field is now green | - | '+adv+' | Verify the bottom has changed to 36, and the field is now red |')); - }, - - doublevalidator: function() - { - // Test Meta-data - testApplication = "Elements: DoubleValidator"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the DoubleValidator element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the DoubleValidator list item | Verify it shows a green field with the number 0. The upper and lower bounds are 30.06 and 30.02 | - | '+adv+' | Verify the number is now 30.01, and the field is now red | - | '+adv+' | Verify the number is now 30.02, and the field is now green | - | '+adv+' | Verify the number is now 30.08, and the field is now red | - | '+adv+' | Verify the top value has changed to 30.09, and the field is now green | - | '+adv+' | Verify the bottom has changed to 40.05, and the field is now red |')); - }, - - regexpvalidator: function() - { - // Test Meta-data - testApplication = "Elements: RegExpValidator"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the RegExpValidator element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the RegExpValidator list item | Verify it shows a green field with the text abc | - | '+adv+' | Verify the text is now 123, and the field is now red | - | '+adv+' | Verify the number is now aa, and the field is still red | - | '+adv+' | Verify the number is now abcd, and the field is still red | - | '+adv+' | Verify the regex value has changed to allow four characters, and the field is now green |')); - }, - - column: function() - { - // Test Meta-data - testApplication = "Elements: Column"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Column element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Column list item | Verify it shows three rectangles - green, red and black | - | '+adv+' | Verify the blue rectangle slid in to place between the red and black rectangles |')); - }, - - row: function() - { - // Test Meta-data - testApplication = "Elements: Row"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Row element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; +testcase = { - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Row list item | Verify it shows three rectangles - green, red and black | - | '+adv+' | Verify the blue rectangle slid in to place between the red and black rectangles |')); + pre_existing_elements_data: { + // ElementName: [preconditions,[groups]] + Rectangle: ["",["QtQuick1.0","BAT"]], + Image: ["",["QtQuick1.0","BAT"]], + AnimatedImage: ["",["QtQuick1.0","BAT"]], + BorderImage: ["",["QtQuick1.0","BAT"]], + SystemPalette: ["",["QtQuick1.0","BAT"]], + Text: ["",["QtQuick1.0","BAT"]], + TextInput: ["",["QtQuick1.0","BAT"]], + TextEdit: ["",["QtQuick1.0","BAT"]], + FontLoader: ["",["QtQuick1.0","BAT"]], + Flipable: ["",["QtQuick1.0","BAT"]], + Flickable: ["",["QtQuick1.0","BAT"]], + IntValidator: ["",["QtQuick1.0","BAT"]], + DoubleValidator: ["",["QtQuick1.0","BAT"]], + RegExpValidator: ["",["QtQuick1.0","BAT"]], + Column: ["",["QtQuick1.0","BAT"]], + Row: ["",["QtQuick1.0","BAT"]], + Flow: ["",["QtQuick1.0","BAT"]], + Grid: ["",["QtQuick1.0","BAT"]], + Repeater: ["",["QtQuick1.0","BAT"]], + ListView: ["",["QtQuick1.0","BAT"]], + Keys: ["",["QtQuick1.0","BAT"]], + MouseArea: ["",["QtQuick1.0","BAT"]], + SequentialAnimation: ["",["QtQuick1.0","BAT"]], + ParallelAnimation: ["",["QtQuick1.0","BAT"]], + XmlListModel: ["",["QtQuick1.0","BAT"]], + Scale: ["",["QtQuick1.0","BAT"]] }, - flow: function() - { + pre_existing_elements: function(prec,groups) { // Test Meta-data - testApplication = "Elements: Flow"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Flow element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; + testTitle = currentDataTag()+ " Element"; + testBinary = "qmlscene tests/testapplications/elements/elements.qml"; + testGoal = "Verify the "+currentDataTag()+" element is shown correctly"; + testPreconditions = prec; + testGroups = groups; // Test Steps - prompt(twiki('---+++ ' + testApplication + '

+ prompt(twiki('---+++ ' + testTitle + '

*Goal:* ' + testGoal + '
*Pre-Requisites:* ' + testPreconditions + '
*Tested Binary:* ' + testBinary + '
- | Select the Flow list item | Verify it shows three rectangles - green (1), red (2, to the right of 1) and black (4, below 1) | - | '+adv+' | Verify the blue rectangle appears where the black was, the black sliding to the right | - | '+adv+' | Verify the direction of the numbers is now in two columns | - | '+adv+' | Verify the direction of the numbers has now reversed, still in columns, but progressing from the right to left |')); + | Select the '+currentDataTag()+' list item | Verify that the '+currentDataTag()+' application is displayed | + | Follow the instructions in the in-app test | Verify all steps are completed successfully |')); }, - grid: function() - { - // Test Meta-data - testApplication = "Elements: Grid"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Grid element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; - - // Test Steps - prompt(twiki('---+++ ' + testApplication + '

- *Goal:* ' + testGoal + '
- *Pre-Requisites:* ' + testPreconditions + '
- *Tested Binary:* ' + testBinary + '
- | Select the Grid list item | Verify it shows four rectangles - green, a red to the right and a black below | - | '+adv+' | Verify the blue rectangle slid in to place previously held by the black rectangle |')); + new_elements_data: { + // ElementName: [preconditions,[groups]] + ParticleSystem: ["",["QtQuick2.0","BAT"]], + ImageParticle: ["",["QtQuick2.0","BAT"]], + Emitter: ["",["QtQuick2.0","BAT"]], + Affector: ["",["QtQuick2.0","BAT"]], + Shape: ["",["QtQuick2.0","BAT"]], + TrailEmitter: ["",["QtQuick2.0","BAT"]], + Direction: ["",["QtQuick2.0","BAT"]] }, - repeater: function() - { + new_elements: function(prec,groups) { // Test Meta-data - testApplication = "Elements: Repeater"; - testBinary = "tests/testapplications/elements/elements"; - testGoal = "Verify the Repeater element is shown correctly"; - testPreconditions = ""; - testGroups = "BAT"; + testTitle = currentDataTag()+ " Element"; + testBinary = "qmlscene tests/testapplications/elements/elements.qml"; + testGoal = "Verify the "+currentDataTag()+" element is shown correctly"; + testPreconditions = prec; + testGroups = groups; // Test Steps - prompt(twiki('---+++ ' + testApplication + '

+ prompt(twiki('---+++ ' + testTitle + '

*Goal:* ' + testGoal + '
*Pre-Requisites:* ' + testPreconditions + '
*Tested Binary:* ' + testBinary + '
- | Select the Repeater list item | Verify it shows five blue rectangles with text and a green rectangle at the bottom | - | '+adv+' | Verify the third blue rectangle is now gone and the others bounced up to fill the gap |')); + | Select the '+currentDataTag()+' list item | Verify that the '+currentDataTag()+' application is displayed | + | Follow the instructions in the in-app test | Verify all steps are completed successfully |')); } } diff --git a/tests/testapplications/elements/content/AffectorElement.qml b/tests/testapplications/elements/content/AffectorElement.qml new file mode 100644 index 0000000..9edd399 --- /dev/null +++ b/tests/testapplications/elements/content/AffectorElement.qml @@ -0,0 +1,184 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: affectorelementtest + anchors.fill: parent + property string testtext: "" + + ParticleSystem { + id: particlesystem + anchors.fill: parent + + ImageParticle { + id: imageparticle + source: "pics/star.png" + color: "blue" + entryEffect: ImageParticle.None + anchors.fill: parent + } + + // Pipe + Rectangle { + id: pipe + x: 0; y: 300 + border.color: "black" + gradient: Gradient { + GradientStop { position: 0.0; color: "lightgray" } + GradientStop { position: 1.0; color: "gray" } + } + height: 40; width: 40 + } + Rectangle { + id: pipehead + anchors.left: pipe.right + anchors.verticalCenter: pipe.verticalCenter + border.color: "black" + gradient: Gradient { + GradientStop { position: 0.0; color: "lightgray" } + GradientStop { position: 1.0; color: "gray" } + } + height: 50; width: 10 + } + + Emitter { + id: emitterelement + anchors.left: pipe.left + anchors.leftMargin: 10 + anchors.bottom: pipe.bottom + anchors.bottomMargin: 8 + height: 5 + emitRate: 100 + lifeSpan: 10000 + speed: AngleDirection { angle: 0; magnitude: 30 } + } + + // Affectors + Gravity { + id: gravity + x: pipe.width; y: pipe.y-100 + enabled: false + height: 200 + width: parent.width - pipe.width + angle: 90 + acceleration: 30 + } + Wander { + id: wander + enabled: false + anchors.verticalCenter: pipe.verticalCenter + anchors.left: pipe.right + height: pipe.height + width: 5 + xVariance: 50 + yVariance: 100 + pace: 200 + } + Turbulence { + id: turbulence + enabled: false + strength: 40 + anchors.bottom: parent.bottom + anchors.bottomMargin: 100 + width: parent.width; height: 100 + } + Friction { + id: friction + anchors.bottom: parent.bottom; width: parent.width; height: 100 + enabled: false + factor: 2 + } + Age { + id: age + anchors.bottom: parent.bottom; width: 360; height: 5 + } + + } + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: affectorelementtest + testtext: "This is a group of currently disabled Affector elements. "+ + "A blue stream of particles should be flowing from a block to the left.\n"+ + "Next, let's add some variance in direction when the particles leave the block." } + }, + State { name: "spread"; when: statenum == 2 + PropertyChanges { target: wander; enabled: true } + PropertyChanges { target: affectorelementtest + testtext: "The particles should be spreading out as they progress.\n"+ + "Next, let's introduce gravity." } + }, + State { name: "gravity"; when: statenum == 3 + PropertyChanges { target: wander; enabled: true } + PropertyChanges { target: gravity; enabled: true } + PropertyChanges { target: affectorelementtest + testtext: "The particles should now be dropping.\n"+ + "Also, no particles should be visible below the bounds of the application, "+ + "i.e. the white panel.\n"+ + "Next, let's introduce some friction at the bottom of the display." } + }, + State { name: "friction"; when: statenum == 4 + PropertyChanges { target: wander; enabled: true } + PropertyChanges { target: gravity; enabled: true } + PropertyChanges { target: friction; enabled: true } + PropertyChanges { target: affectorelementtest + testtext: "The particles should now be decelerating suddenly at the bottom.\n"+ + "Next, let's add some turbulence to the flow." } + }, + State { name: "turbulence"; when: statenum == 5 + PropertyChanges { target: wander; enabled: true } + PropertyChanges { target: gravity; enabled: true } + PropertyChanges { target: friction; enabled: true } + PropertyChanges { target: turbulence; enabled: true } + PropertyChanges { target: affectorelementtest + testtext: "The particles should now be turbulent.\n"+ + "Advance to restart the test." } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/DirectionElement.qml b/tests/testapplications/elements/content/DirectionElement.qml new file mode 100644 index 0000000..2e2003c --- /dev/null +++ b/tests/testapplications/elements/content/DirectionElement.qml @@ -0,0 +1,127 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: directionelementtest + anchors.fill: parent + property string testtext: "" + + ParticleSystem { + id: particlesystem + anchors.fill: parent + Item { + id: targetbox + x: 50 + y: 300 + Rectangle { + id: targeticon + color: "brown" + height: 0; width: 0; radius: 20 + anchors.centerIn: parent + Behavior on height { NumberAnimation { duration: 500; easing.type: Easing.OutBounce } } + Behavior on width { NumberAnimation { duration: 500; easing.type: Easing.OutBounce } } + } + } + ImageParticle { + id: imgparticle + source: "pics/star.png" + color: "red" + entryEffect: ImageParticle.None + } + Emitter { + id: emitter + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + anchors.horizontalCenter: parent.horizontalCenter + emitRate: 50 + lifeSpan: 4000 + size: 20 + speed: angledirectionelement + AngleDirection { id: angledirectionelement; angle: -75; angleVariation: 5; magnitude: 150 } + TargetDirection { id: targetdirectionelement; targetItem: targetbox; targetVariation: 10; magnitude: 150 } + PointDirection { id: pointdirectionelement; y: -100; xVariation: 10; yVariation: 10; } + PointDirection { id: pointdirectionelementdownward; y: 200 } + CumulativeDirection { + id: cumulativedirectionelement + PointDirection { y: -200 } + AngleDirection { angle: 270; angleVariation: 45; magnitude: 100; magnitudeVariation: 10; } + } + } + } + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: directionelementtest + testtext: "This is an Emitter with the direction set by an AngleDirection.\n"+ + "The particles should be firing at a -75 degree (to the top right) .\n"+ + "Next, let's change the Emitter to target an item." } + }, + State { name: "ontarget"; when: statenum == 2 + PropertyChanges { target: emitter; speed: targetdirectionelement } + PropertyChanges { target: targeticon; height: 50; width: 50 } + PropertyChanges { target: directionelementtest + testtext: "The particles should be directed at the rectangle.\n"+ + "Next, let's set an arbritary point to direct the particles to." } + }, + State { name: "onpoint"; when: statenum == 3 + PropertyChanges { target: emitter; speed: pointdirectionelement } + PropertyChanges { target: directionelementtest + testtext: "The particles should be directed upwards with a small amount of spread.\n"+ + "Next, let's create a fountain with CumulativeDirection and a downward PointDirection" } + }, + State { name: "cumulative"; when: statenum == 4 + PropertyChanges { target: emitter; emitRate: 200; speed: cumulativedirectionelement + acceleration: pointdirectionelementdownward } + PropertyChanges { target: imgparticle; color: "aqua"; colorVariation: .2 } + PropertyChanges { target: directionelementtest + testtext: "The particles should be flowing upwards and falling in a fountain effect.\n"+ + "Advance to restart the test." } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/EmitterElement.qml b/tests/testapplications/elements/content/EmitterElement.qml new file mode 100644 index 0000000..5842ffb --- /dev/null +++ b/tests/testapplications/elements/content/EmitterElement.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: emitterelementtest + anchors.fill: parent + property string testtext: "" + + ParticleSystem { + id: particlesystem + anchors.fill: parent + ImageParticle { + id: imageparticle + source: "pics/smile.png" + color: "red" + Behavior on color { ColorAnimation { duration: 3000 } } + } + Emitter { + id: emitterelement + anchors.centerIn: parent + property int emitspeed: 10 + emitRate: 5 + lifeSpan: 1000 + speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: emitterelement.emitspeed } + } + } + + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: emitterelementtest + testtext: "This is an Emitter element, visualized by an ImageParticle. It should be emitting particles "+ + "slowly from the center of the display.\n"+ + "Next, let's change the emission speed of the particles." } + }, + State { name: "fast"; when: statenum == 2 + PropertyChanges { target: emitterelement; emitspeed: 50 } + PropertyChanges { target: emitterelementtest + testtext: "The particles emitted should be moving more quickly.\n"+ + "Next, let's increase the number of particles emitted." } + }, + State { name: "many"; when: statenum == 3 + PropertyChanges { target: emitterelement; emitspeed: 50; emitRate: 100 } + PropertyChanges { target: emitterelementtest + testtext: "The particles should now be quick and numerous.\n"+ + "Next, let's allow them to survive longer." } + }, + State { name: "enduring"; when: statenum == 4 + PropertyChanges { target: emitterelement; emitspeed: 50; emitRate: 100; lifeSpan: 3000 } + PropertyChanges { target: emitterelementtest + testtext: "The particles should now be enduring to the edges of the display.\n"+ + "Next, let's have them changing their size." } + }, + State { name: "sized"; when: statenum == 5 + PropertyChanges { target: emitterelement; emitspeed: 50; emitRate: 100; lifeSpan: 3000; size: 20; endSize: 5 } + PropertyChanges { target: emitterelementtest + testtext: "The particles should now be starting large and ending small.\n"+ + "Advance to restart the test." } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/GridViewElement.qml b/tests/testapplications/elements/content/GridViewElement.qml index 10390fe..2b9884d 100644 --- a/tests/testapplications/elements/content/GridViewElement.qml +++ b/tests/testapplications/elements/content/GridViewElement.qml @@ -116,5 +116,12 @@ Rectangle { ListElement { label: "ParallelAnimation"; help: "The ParallelAnimation element allows animations to be run in parallel." } ListElement { label: "XmlListModel"; help: "The XmlListModel element is used to specify a read-only model using XPath expressions." } ListElement { label: "Scale"; help: "The Scale element provides a way to scale an Item." } + ListElement { label: "ParticleSystem"; help: "The ParticleSystem brings together ParticlePainter, Emitter and Affector elements." } + ListElement { label: "ImageParticle"; help: "The ImageParticle element visualizes logical particles using an image." } + ListElement { label: "Emitter"; help: "The Emitter element allows you to emit logical particles." } + ListElement { label: "Affector"; help: "Affector elements can alter the attributes of logical particles at any point in their lifetime." } + ListElement { label: "Shape"; help: "The Shape element allows you to specify an area for affectors and emitter." } + ListElement { label: "TrailEmitter"; help: "The TrailEmitter element allows you to emit logical particles from other logical particles." } + ListElement { label: "Direction"; help: "The Direction elements allow you to specify a vector space." } } } diff --git a/tests/testapplications/elements/content/ImageParticleElement.qml b/tests/testapplications/elements/content/ImageParticleElement.qml new file mode 100644 index 0000000..fd6ef05 --- /dev/null +++ b/tests/testapplications/elements/content/ImageParticleElement.qml @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: imageparticleelementtest + anchors.fill: parent + property string testtext: "" + + ParticleSystem { + id: particlesystemelement + anchors.fill: parent + ImageParticle { + id: imageparticle + source: "pics/smile.png" + color: "red" + Behavior on color { ColorAnimation { duration: 3000 } } + } + Emitter { + id: particleemitter + anchors.centerIn: parent + emitRate: 50 + lifeSpan: 3000 + speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: 60 } + } + } + + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: imageparticleelementtest + testtext: "This is an ImageParticle element. It should be emitting particles "+ + "from the center of the display.\n"+ + "Next, let's change the color of the particles." } + }, + State { name: "green"; when: statenum == 2 + PropertyChanges { target: imageparticle; color: "lightgreen" } + PropertyChanges { target: imageparticleelementtest + testtext: "The particles should now be green.\n"+ + "Next, let's get them spinning." } + }, + State { name: "spinning"; when: statenum == 3 + PropertyChanges { target: imageparticle; color: "lightgreen"; rotation: 360; rotationSpeed: 100 } + PropertyChanges { target: imageparticleelementtest + testtext: "The particles should now be green and spinning.\n"+ + "Next, let's get them popping in and out." } + }, + State { name: "scaling"; when: statenum == 4 + PropertyChanges { target: imageparticle; color: "lightgreen"; rotation: 360; rotationSpeed: 100; entryEffect: ImageParticle.Scale } + PropertyChanges { target: imageparticleelementtest + testtext: "The particles should now be scaling in and out.\n"+ + "Advance to restart the test." } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/ParticleSystemElement.qml b/tests/testapplications/elements/content/ParticleSystemElement.qml new file mode 100644 index 0000000..d7eeb20 --- /dev/null +++ b/tests/testapplications/elements/content/ParticleSystemElement.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: particlesystemelementtest + anchors.fill: parent + property string testtext: "" + Rectangle { x: 50; y: 200; height: 300; width: 260; color: "transparent"; border.color: "lightgray" } + ParticleSystem { + id: particlesystemelement + anchors.fill: parent + ImageParticle { source: "pics/star.png"; color: "red" } + Emitter { + id: particleemitter + x: 50; y: 200 + emitRate: 100 + speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: 100 } + Rectangle { anchors.centerIn: parent; height: 1; width: 1; color: "black" } + SequentialAnimation { + running: true; paused: particlesystemelement.paused; loops: Animation.Infinite + NumberAnimation { target: particleemitter; properties: "x"; to: 310; duration: 3000 } + NumberAnimation { target: particleemitter; properties: "y"; to: 500; duration: 3000 } + NumberAnimation { target: particleemitter; properties: "x"; to: 50; duration: 3000 } + NumberAnimation { target: particleemitter; properties: "y"; to: 200; duration: 3000 } + } + } + } + + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: particlesystemelementtest + testtext: "This is an ParticleSystem element. It is represented by an ImageParticle, "+ + "tracing around the display.\n"+ + "Next, it should pause simulation." } + }, + State { name: "paused"; when: statenum == 2 + PropertyChanges { target: particlesystemelement; paused: true } + PropertyChanges { target: particlesystemelementtest + testtext: "The simulation should now be paused.\n"+ + "Advance to resume simulation." } + }, + State { name: "resumed"; when: statenum == 3 + PropertyChanges { target: bugpanel; bugnumber: "21539" } + PropertyChanges { target: particlesystemelement; paused: false } + PropertyChanges { target: particlesystemelementtest + testtext: "The simulation should now be active.\n"+ + "Advance to restart the test" } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/ShapeElement.qml b/tests/testapplications/elements/content/ShapeElement.qml new file mode 100644 index 0000000..e72fcaf --- /dev/null +++ b/tests/testapplications/elements/content/ShapeElement.qml @@ -0,0 +1,149 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: shapeelementtest + anchors.fill: parent + property string testtext: "" + + ParticleSystem { + id: particlesystem + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: 20 + height: 300 + width: 300 + + ImageParticle { + id: imageparticle + source: "pics/star.png" + color: "red" + } + + Emitter { + id: emitter + property real magn: 0.1 + anchors.fill: parent + emitRate: 500 + lifeSpan: 2000 + speed: TargetDirection { + targetX: particlesystem.width/2 + targetY: particlesystem.height/2 + proportionalMagnitude: true + magnitude: emitter.magn + magnitudeVariation: emitter.magn + } + shape: rectangleshapeelement + } + Emitter { + id: emitter2 + enabled: false + anchors.fill: parent + emitRate: 200 + lifeSpan: 1000 + speed: TargetDirection { + targetX: particlesystem.width/2 + targetY: particlesystem.height/2 + proportionalMagnitude: true + magnitude: 0 + magnitudeVariation: 0 + } + shape: lineshapeelement2 + } + // Shapes + EllipseShape { + id: ellipseshapeelement + fill: false + } + RectangleShape { + id: rectangleshapeelement + fill: false + } + LineShape { + id: lineshapeelement + } + LineShape { + id: lineshapeelement2 + mirrored: true + } + MaskShape { + id: maskshapeelement + source: "pics/logo-hollowed.png" + } + } + + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: shapeelementtest + testtext: "This is an Shape element, used by Emitter. There should be a rectangle "+ + "shape emitting into its center.\n"+ + "Next, let's change the shape to an ellipse." } + }, + State { name: "ellipse"; when: statenum == 2 + PropertyChanges { target: emitter; shape: ellipseshapeelement } + PropertyChanges { target: shapeelementtest + testtext: "The particles should now be emitted in a circular shape.\n"+ + "Next, let's change the shape to a line." } + }, + State { name: "line"; when: statenum == 3 + PropertyChanges { target: emitter; shape: lineshapeelement; lifeSpan: 1000; emitRate: 200; } + PropertyChanges { target: emitter2; enabled: true } + PropertyChanges { target: shapeelementtest + testtext: "The particles should now be emitted from two lines, creating an X shape.\n"+ + "Next, let's change the shape to an image." } + }, + State { name: "enduring"; when: statenum == 4 + PropertyChanges { target: emitter; shape: maskshapeelement; lifeSpan: 1000; emitRate: 1000; magn: 0 } + PropertyChanges { target: shapeelementtest + testtext: "The particles should now be sparkling, stationary within a 'Qt' text image.\n"+ + "Advance to restart the test." } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/TrailEmitterElement.qml b/tests/testapplications/elements/content/TrailEmitterElement.qml new file mode 100644 index 0000000..d90b760 --- /dev/null +++ b/tests/testapplications/elements/content/TrailEmitterElement.qml @@ -0,0 +1,165 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: trailemitterelementtest + anchors.fill: parent + property string testtext: "" + + ParticleSystem { + id: particlesystem + anchors.fill: parent + Image { + id: backgroundpic + anchors.fill: parent + source: "pics/logo.png" + opacity: 0 + Behavior on opacity { NumberAnimation { duration: 1000 } } + } + ImageParticle { + id: omissile + source: "pics/star.png" + color: "orange" + entryEffect: ImageParticle.None + groups: ["orangemissile"] + } + ImageParticle { + id: gmissile + source: "pics/star.png" + color: "green" + entryEffect: ImageParticle.None + groups: ["greenmissile"] + } + ImageParticle { + id: sparks + source: "pics/star.png" + color: "red" + colorVariation: .5 + entryEffect: ImageParticle.None + groups: ["sparks"] + } + Emitter { + id: emitter + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + anchors.horizontalCenter: parent.horizontalCenter + emitRate: 1 + lifeSpan: 3000 + size: 20 + speed: AngleDirection { angle: 270; angleVariation: 25; magnitude: 150 } + group: "orangemissile" + } + Emitter { + id: emitter2 + anchors.bottom: parent.bottom + anchors.bottomMargin: 5 + anchors.horizontalCenter: parent.horizontalCenter + emitRate: 1 + lifeSpan: 3000 + size: 20 + speed: AngleDirection { angle: 270; angleVariation: 25; magnitude: 150 } + group: "greenmissile" + } + Gravity { + anchors.fill: parent + angle: 90 + acceleration: 30 + } + TrailEmitter { + id: trailemitterelement + follow: "orangemissile" + group:"sparks" + anchors.fill: parent + emitRatePerParticle: 50 + lifeSpan: 1000 + speedFromMovement: .2 + speed: AngleDirection { angle: 0; angleVariation: 360; magnitude: 5 } + maximumEmitted: 500 + shape: basicshape + } + + RectangleShape { id: basicshape } + + MaskShape { + id: maskshape + source: "pics/logo-hollowed.png" + } + + } + + SystemTestHelp { id: helpbubble; visible: statenum != 0 + anchors { top: parent.top; horizontalCenter: parent.horizontalCenter; topMargin: 50 } + } + BugPanel { id: bugpanel } + + states: [ + State { name: "start"; when: statenum == 1 + PropertyChanges { target: trailemitterelementtest + testtext: "This is a TrailEmitter, with particles following the orange particles.\n"+ + "The green particles should not be followed by other particles.\n"+ + "Next, let's change the sparks to follow the green particles." } + }, + State { name: "followgreen"; when: statenum == 2 + PropertyChanges { target: trailemitterelement; follow: "greenmissile" } + PropertyChanges { target: trailemitterelementtest + testtext: "The particles should be following the green particles.\n"+ + "Next, let's add a shape to emit within." } + }, + State { name: "onlyinshape"; when: statenum == 3 + PropertyChanges { target: trailemitterelement; follow: "greenmissile"; shape: maskshape } + PropertyChanges { target: backgroundpic; opacity: .5 } + PropertyChanges { target: trailemitterelementtest + testtext: "The particles should now be only emitted when they pass through the 'Qt' text.\n"+ + "Next, let's create small Qt missiles." } + }, + State { name: "emittingashape"; when: statenum == 4 + PropertyChanges { target: trailemitterelement; follow: "greenmissile"; shape: basicshape + emitHeight: 60; emitWidth: 60; emitRatePerParticle: 1500; emitShape: maskshape; maximumEmitted: 1500; lifeSpan: 50 + } + PropertyChanges { target: trailemitterelementtest + testtext: "The particles should now be Qt text shaped particles.\n"+ + "Advance to restart the test." } + } + ] +} \ No newline at end of file diff --git a/tests/testapplications/elements/content/pics/logo-hollowed.png b/tests/testapplications/elements/content/pics/logo-hollowed.png new file mode 100644 index 0000000..ca2acb3 Binary files /dev/null and b/tests/testapplications/elements/content/pics/logo-hollowed.png differ diff --git a/tests/testapplications/elements/content/pics/smile.png b/tests/testapplications/elements/content/pics/smile.png new file mode 100644 index 0000000..3d66d72 Binary files /dev/null and b/tests/testapplications/elements/content/pics/smile.png differ diff --git a/tests/testapplications/elements/content/pics/star.png b/tests/testapplications/elements/content/pics/star.png new file mode 100644 index 0000000..0d592cf Binary files /dev/null and b/tests/testapplications/elements/content/pics/star.png differ