aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/declarative/plasmapatrol/PlasmaPatrol.qmlproject18
-rw-r--r--demos/declarative/plasmapatrol/TODO10
-rw-r--r--demos/declarative/plasmapatrol/content/BlasterHardpoint.qml133
-rw-r--r--demos/declarative/plasmapatrol/content/Button.qml66
-rw-r--r--demos/declarative/plasmapatrol/content/CannonHardpoint.qml97
-rw-r--r--demos/declarative/plasmapatrol/content/ChoiceBox.qml105
-rw-r--r--demos/declarative/plasmapatrol/content/Cruiser.qml146
-rw-r--r--demos/declarative/plasmapatrol/content/Frigate.qml114
-rw-r--r--demos/declarative/plasmapatrol/content/Hardpoint.qml112
-rw-r--r--demos/declarative/plasmapatrol/content/HelpScreens.qml268
-rw-r--r--demos/declarative/plasmapatrol/content/LaserHardpoint.qml108
-rw-r--r--demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml173
-rw-r--r--demos/declarative/plasmapatrol/content/SequentialLoader.qml54
-rw-r--r--demos/declarative/plasmapatrol/content/Ship.qml113
-rw-r--r--demos/declarative/plasmapatrol/content/Sloop.qml108
-rw-r--r--demos/declarative/plasmapatrol/content/pics/TitleText.pngbin0 -> 1109 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/blur-circle2.pngbin0 -> 3627 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/blur-circle3.pngbin0 -> 5148 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/finalfrontier.pngbin0 -> 695061 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/meteor.pngbin0 -> 83169 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/meteor_explo.pngbin0 -> 81528 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/nullRock.pngbin0 -> 140 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/particle.pngbin0 -> 861 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/star.pngbin0 -> 1550 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/star2.pngbin0 -> 6507 bytes
-rw-r--r--demos/declarative/plasmapatrol/content/pics/star3.pngbin0 -> 4602 bytes
-rw-r--r--demos/declarative/plasmapatrol/plasmapatrol.qml386
-rw-r--r--demos/declarative/samegame/SamegameCore/BoomBlock.qml36
-rw-r--r--demos/declarative/samegame/SamegameCore/Button.qml2
-rw-r--r--demos/declarative/samegame/SamegameCore/Dialog.qml7
-rw-r--r--demos/declarative/samegame/SamegameCore/pics/blueStar.pngbin278 -> 0 bytes
-rw-r--r--demos/declarative/samegame/SamegameCore/pics/greenStar.pngbin273 -> 0 bytes
-rw-r--r--demos/declarative/samegame/SamegameCore/pics/particle.pngbin0 -> 861 bytes
-rw-r--r--demos/declarative/samegame/SamegameCore/pics/redStar.pngbin274 -> 0 bytes
-rw-r--r--demos/declarative/samegame/SamegameCore/pics/star.pngbin262 -> 0 bytes
-rwxr-xr-xdemos/declarative/samegame/SamegameCore/samegame.js43
-rw-r--r--demos/declarative/samegame/samegame.qml35
-rw-r--r--demos/declarative/shadereffects/Slider.qml93
-rw-r--r--demos/declarative/shadereffects/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--demos/declarative/shadereffects/qt-logo.pngbin0 -> 13923 bytes
-rw-r--r--demos/declarative/shadereffects/shader-demo.qml295
-rw-r--r--doc/src/declarative/modules.qdoc123
-rw-r--r--doc/src/declarative/qdeclarativeintro.qdoc8
-rw-r--r--doc/src/declarative/whatsnew.qdoc6
-rw-r--r--doc/src/snippets/declarative/models/views-models-delegates.qml1
-rw-r--r--doc/src/snippets/declarative/models/visual-model-and-view.qml1
-rw-r--r--doc/src/snippets/declarative/mousearea/mousearea-snippet.qml2
-rw-r--r--doc/src/snippets/declarative/states/statechangescript.qml1
-rw-r--r--examples/declarative/declarative.pro3
-rw-r--r--examples/declarative/inputmethods/inputmethods.qmlproject16
-rw-r--r--examples/declarative/inputmethods/spellcheck/Key.qml85
-rw-r--r--examples/declarative/inputmethods/spellcheck/Keyboard.qml141
-rw-r--r--examples/declarative/inputmethods/spellcheck/WordSuggestions.qml100
-rw-r--r--examples/declarative/inputmethods/spellcheck/spellcheck.qml137
-rw-r--r--examples/declarative/painteditem/main.cpp85
-rw-r--r--examples/declarative/painteditem/myfile.qml57
-rw-r--r--examples/declarative/painteditem/painteditem.pro14
-rw-r--r--examples/declarative/particles/allsmiles/content/particle.pngbin0 -> 861 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/singlesmile.pngbin0 -> 269 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/sizeInOut.pngbin0 -> 251 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/smileMask.pngbin0 -> 259 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite.pngbin0 -> 496 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite2.pngbin0 -> 459 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite3.pngbin0 -> 476 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite4.pngbin0 -> 553 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite5.pngbin0 -> 623 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite6.pngbin0 -> 615 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacesprite7.pngbin0 -> 581 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacespriteX.pngbin0 -> 474 bytes
-rw-r--r--examples/declarative/particles/allsmiles/content/squarefacespriteXX.pngbin0 -> 255 bytes
-rw-r--r--examples/declarative/particles/allsmiles/smile.qml77
-rw-r--r--examples/declarative/particles/allsmiles/smilefactory.qml118
-rw-r--r--examples/declarative/particles/allsmiles/spriteparticles.qml103
-rw-r--r--examples/declarative/particles/allsmiles/spritestateparticles.qml190
-rw-r--r--examples/declarative/particles/allsmiles/spritevariedparticles.qml117
-rw-r--r--examples/declarative/particles/asteroid/asteroid.qml213
-rw-r--r--examples/declarative/particles/asteroid/blackhole.qml200
-rw-r--r--examples/declarative/particles/asteroid/content/_explo.pngbin0 -> 81528 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/finalfrontier.pngbin0 -> 695061 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/meteor.pngbin0 -> 83169 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/meteor_explo.pngbin0 -> 219946 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/meteors.pngbin0 -> 132137 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/nullRock.pngbin0 -> 140 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/particle4.pngbin0 -> 1799 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/rocket.pngbin0 -> 7315 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/rocket2.pngbin0 -> 1918 bytes
-rw-r--r--examples/declarative/particles/asteroid/content/star.pngbin0 -> 1550 bytes
-rw-r--r--examples/declarative/particles/modelparticles/bubbles.qml81
-rw-r--r--examples/declarative/particles/modelparticles/content/Delegate.qml88
-rw-r--r--examples/declarative/particles/modelparticles/content/Delegate2.qml79
-rw-r--r--examples/declarative/particles/modelparticles/content/ExpandingDelegate.qml204
-rw-r--r--examples/declarative/particles/modelparticles/content/RssModel.qml53
-rw-r--r--examples/declarative/particles/modelparticles/content/bubble.pngbin0 -> 3413 bytes
-rw-r--r--examples/declarative/particles/modelparticles/content/script.js27
-rw-r--r--examples/declarative/particles/modelparticles/gridsplosion.qml146
-rw-r--r--examples/declarative/particles/modelparticles/package.qml91
-rw-r--r--examples/declarative/particles/modelparticles/stream.qml280
-rw-r--r--examples/declarative/particles/snow/content/flake-01.pngbin0 -> 189327 bytes
-rw-r--r--examples/declarative/particles/snow/snow.qml75
-rw-r--r--examples/declarative/particles/snow/snow2.qml74
-rw-r--r--examples/declarative/particles/snow/snow3.qml80
-rw-r--r--examples/declarative/particles/spaceexplorer/content/helpers.js8
-rw-r--r--examples/declarative/particles/spaceexplorer/content/particle4.pngbin0 -> 1799 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/powerupScore.pngbin0 -> 83169 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/powerupScore_gone.pngbin0 -> 140 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/powerupScore_got.pngbin0 -> 81528 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/rocket.pngbin0 -> 7315 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/rocket2.pngbin0 -> 1918 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/rocketEye.pngbin0 -> 2073 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/content/star.pngbin0 -> 1550 bytes
-rw-r--r--examples/declarative/particles/spaceexplorer/spaceexplorer.qml412
-rw-r--r--examples/declarative/particles/trails/content/PetsModel.qml98
-rw-r--r--examples/declarative/particles/trails/content/candle.pngbin0 -> 1348 bytes
-rw-r--r--examples/declarative/particles/trails/content/colortable.pngbin0 -> 704 bytes
-rw-r--r--examples/declarative/particles/trails/content/particle.pngbin0 -> 861 bytes
-rw-r--r--examples/declarative/particles/trails/content/particle2.pngbin0 -> 3909 bytes
-rw-r--r--examples/declarative/particles/trails/content/particle3.pngbin0 -> 3186 bytes
-rw-r--r--examples/declarative/particles/trails/content/particleA.pngbin0 -> 3541 bytes
-rw-r--r--examples/declarative/particles/trails/content/portal_bg.pngbin0 -> 96858 bytes
-rw-r--r--examples/declarative/particles/trails/content/sparkleSize.pngbin0 -> 378 bytes
-rw-r--r--examples/declarative/particles/trails/content/star.pngbin0 -> 1550 bytes
-rw-r--r--examples/declarative/particles/trails/dynamicemitters.qml121
-rw-r--r--examples/declarative/particles/trails/fireballs.qml174
-rw-r--r--examples/declarative/particles/trails/layered.qml93
-rw-r--r--examples/declarative/particles/trails/list.qml120
-rw-r--r--examples/declarative/particles/trails/overburst.qml85
-rw-r--r--examples/declarative/particles/trails/portal.qml110
-rw-r--r--examples/declarative/particles/trails/rainbow.qml82
-rw-r--r--examples/declarative/particles/trails/shimmer.qml73
-rw-r--r--examples/declarative/particles/trails/swarm.qml78
-rw-r--r--examples/declarative/particles/trails/trails.qml87
-rw-r--r--examples/declarative/particles/trails/turbulence.qml129
-rw-r--r--examples/declarative/particles/trails/velocityfrommotion.qml327
-rw-r--r--modules/qt_declarative.pri2
-rw-r--r--src/declarative/debugger/qdeclarativedebug.cpp46
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver.cpp50
-rw-r--r--src/declarative/debugger/qdeclarativedebugserver_p.h3
-rw-r--r--src/declarative/debugger/qdeclarativedebugserverconnection_p.h1
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice.cpp10
-rw-r--r--src/declarative/debugger/qdeclarativedebugservice_p.h2
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace.cpp9
-rw-r--r--src/declarative/debugger/qdeclarativedebugtrace_p.h1
-rw-r--r--src/declarative/debugger/qpacketprotocol.cpp49
-rw-r--r--src/declarative/debugger/qpacketprotocol_p.h2
-rw-r--r--src/declarative/declarative.pro4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp48
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem_p.h11
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp3
-rwxr-xr-xsrc/declarative/items/checksync.pl108
-rw-r--r--src/declarative/items/items.pri109
-rw-r--r--src/declarative/items/qsganchors.cpp1111
-rw-r--r--src/declarative/items/qsganchors_p.h201
-rw-r--r--src/declarative/items/qsganchors_p_p.h173
-rw-r--r--src/declarative/items/qsganimatedimage.cpp304
-rw-r--r--src/declarative/items/qsganimatedimage_p.h117
-rw-r--r--src/declarative/items/qsganimatedimage_p_p.h88
-rw-r--r--src/declarative/items/qsganimation.cpp442
-rw-r--r--src/declarative/items/qsganimation_p.h132
-rw-r--r--src/declarative/items/qsganimation_p_p.h97
-rw-r--r--src/declarative/items/qsgborderimage.cpp359
-rw-r--r--src/declarative/items/qsgborderimage_p.h110
-rw-r--r--src/declarative/items/qsgborderimage_p_p.h109
-rw-r--r--src/declarative/items/qsgcanvas.cpp1897
-rw-r--r--src/declarative/items/qsgcanvas.h118
-rw-r--r--src/declarative/items/qsgcanvas_p.h195
-rw-r--r--src/declarative/items/qsgclipnode.cpp121
-rw-r--r--src/declarative/items/qsgclipnode_p.h71
-rw-r--r--src/declarative/items/qsgevents.cpp47
-rw-r--r--src/declarative/items/qsgevents_p_p.h142
-rw-r--r--src/declarative/items/qsgflickable.cpp1495
-rw-r--r--src/declarative/items/qsgflickable_p.h230
-rw-r--r--src/declarative/items/qsgflickable_p_p.h243
-rw-r--r--src/declarative/items/qsgflipable.cpp255
-rw-r--r--src/declarative/items/qsgflipable_p.h104
-rw-r--r--src/declarative/items/qsgfocusscope.cpp57
-rw-r--r--src/declarative/items/qsgfocusscope_p.h68
-rw-r--r--src/declarative/items/qsggridview.cpp2657
-rw-r--r--src/declarative/items/qsggridview_p.h290
-rw-r--r--src/declarative/items/qsgimage.cpp298
-rw-r--r--src/declarative/items/qsgimage_p.h104
-rw-r--r--src/declarative/items/qsgimage_p_p.h81
-rw-r--r--src/declarative/items/qsgimagebase.cpp285
-rw-r--r--src/declarative/items/qsgimagebase_p.h117
-rw-r--r--src/declarative/items/qsgimagebase_p_p.h93
-rw-r--r--src/declarative/items/qsgimplicitsizeitem.cpp93
-rw-r--r--src/declarative/items/qsgimplicitsizeitem_p.h101
-rw-r--r--src/declarative/items/qsgimplicitsizeitem_p_p.h92
-rw-r--r--src/declarative/items/qsgitem.cpp3143
-rw-r--r--src/declarative/items/qsgitem.h399
-rw-r--r--src/declarative/items/qsgitem_p.h712
-rw-r--r--src/declarative/items/qsgitemchangelistener_p.h82
-rw-r--r--src/declarative/items/qsgitemsmodule.cpp205
-rw-r--r--src/declarative/items/qsgitemsmodule_p.h65
-rw-r--r--src/declarative/items/qsglistview.cpp3057
-rw-r--r--src/declarative/items/qsglistview_p.h374
-rw-r--r--src/declarative/items/qsgloader.cpp340
-rw-r--r--src/declarative/items/qsgloader_p.h107
-rw-r--r--src/declarative/items/qsgloader_p_p.h91
-rw-r--r--src/declarative/items/qsgmousearea.cpp800
-rw-r--r--src/declarative/items/qsgmousearea_p.h219
-rw-r--r--src/declarative/items/qsgmousearea_p_p.h115
-rw-r--r--src/declarative/items/qsgninepatchnode.cpp275
-rw-r--r--src/declarative/items/qsgninepatchnode_p.h94
-rw-r--r--src/declarative/items/qsgpainteditem.cpp363
-rw-r--r--src/declarative/items/qsgpainteditem.h114
-rw-r--r--src/declarative/items/qsgpainteditem_p.h68
-rw-r--r--src/declarative/items/qsgpathview.cpp1412
-rw-r--r--src/declarative/items/qsgpathview_p.h254
-rw-r--r--src/declarative/items/qsgpathview_p_p.h193
-rw-r--r--src/declarative/items/qsgpincharea.cpp421
-rw-r--r--src/declarative/items/qsgpincharea_p.h315
-rw-r--r--src/declarative/items/qsgpincharea_p_p.h115
-rw-r--r--src/declarative/items/qsgpositioners.cpp788
-rw-r--r--src/declarative/items/qsgpositioners_p.h242
-rw-r--r--src/declarative/items/qsgpositioners_p_p.h174
-rw-r--r--src/declarative/items/qsgrectangle.cpp290
-rw-r--r--src/declarative/items/qsgrectangle_p.h184
-rw-r--r--src/declarative/items/qsgrectangle_p_p.h109
-rw-r--r--src/declarative/items/qsgrepeater.cpp294
-rw-r--r--src/declarative/items/qsgrepeater_p.h111
-rw-r--r--src/declarative/items/qsgrepeater_p_p.h83
-rw-r--r--src/declarative/items/qsgscalegrid.cpp213
-rw-r--r--src/declarative/items/qsgscalegrid_p_p.h134
-rw-r--r--src/declarative/items/qsgshadereffectitem.cpp449
-rw-r--r--src/declarative/items/qsgshadereffectitem_p.h159
-rw-r--r--src/declarative/items/qsgshadereffectmesh.cpp167
-rw-r--r--src/declarative/items/qsgshadereffectmesh_p.h102
-rw-r--r--src/declarative/items/qsgshadereffectnode.cpp322
-rw-r--r--src/declarative/items/qsgshadereffectnode_p.h148
-rw-r--r--src/declarative/items/qsgshadereffectsource.cpp530
-rw-r--r--src/declarative/items/qsgshadereffectsource_p.h220
-rw-r--r--src/declarative/items/qsgstateoperations.cpp1347
-rw-r--r--src/declarative/items/qsgstateoperations_p.h275
-rw-r--r--src/declarative/items/qsgtext.cpp1249
-rw-r--r--src/declarative/items/qsgtext_p.h214
-rw-r--r--src/declarative/items/qsgtext_p_p.h155
-rw-r--r--src/declarative/items/qsgtextedit.cpp1232
-rw-r--r--src/declarative/items/qsgtextedit_p.h303
-rw-r--r--src/declarative/items/qsgtextedit_p_p.h143
-rw-r--r--src/declarative/items/qsgtextinput.cpp1294
-rw-r--r--src/declarative/items/qsgtextinput_p.h302
-rw-r--r--src/declarative/items/qsgtextinput_p_p.h154
-rw-r--r--src/declarative/items/qsgtextnode.cpp457
-rw-r--r--src/declarative/items/qsgtextnode_p.h84
-rw-r--r--src/declarative/items/qsgtranslate.cpp297
-rw-r--r--src/declarative/items/qsgtranslate_p.h162
-rw-r--r--src/declarative/items/qsgview.cpp466
-rw-r--r--src/declarative/items/qsgview.h120
-rw-r--r--src/declarative/items/qsgvisualitemmodel.cpp1247
-rw-r--r--src/declarative/items/qsgvisualitemmodel_p.h257
-rw-r--r--src/declarative/items/syncexcludes11
-rw-r--r--src/declarative/qml/qdeclarative.h33
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp19
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp2906
-rw-r--r--src/declarative/qml/qdeclarativecompileddata.cpp3
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp149
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h5
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp39
-rw-r--r--src/declarative/qml/qdeclarativecomponent.h1
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp84
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h11
-rw-r--r--src/declarative/qml/qdeclarativedirparser.cpp23
-rw-r--r--src/declarative/qml/qdeclarativedirparser_p.h16
-rw-r--r--src/declarative/qml/qdeclarativedom.cpp1835
-rw-r--r--src/declarative/qml/qdeclarativedom_p.h362
-rw-r--r--src/declarative/qml/qdeclarativedom_p_p.h157
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp135
-rw-r--r--src/declarative/qml/qdeclarativeengine.h3
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h25
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp7
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.cpp33
-rw-r--r--src/declarative/qml/qdeclarativeimageprovider.h5
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp208
-rw-r--r--src/declarative/qml/qdeclarativeimport_p.h6
-rw-r--r--src/declarative/qml/qdeclarativeinfo.cpp12
-rw-r--r--src/declarative/qml/qdeclarativeinstruction.cpp3
-rw-r--r--src/declarative/qml/qdeclarativeinstruction_p.h7
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp96
-rw-r--r--src/declarative/qml/qdeclarativemetatype_p.h39
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp27
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h17
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp2
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h21
-rw-r--r--src/declarative/qml/qdeclarativescarceresourcescriptclass.cpp193
-rw-r--r--src/declarative/qml/qdeclarativescarceresourcescriptclass_p.h163
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp47
-rw-r--r--src/declarative/qml/qdeclarativescriptparser_p.h2
-rw-r--r--src/declarative/qml/qdeclarativetypeloader.cpp244
-rw-r--r--src/declarative/qml/qdeclarativetypeloader_p.h62
-rw-r--r--src/declarative/qml/qdeclarativetypenamecache.cpp8
-rw-r--r--src/declarative/qml/qdeclarativetypenamecache_p.h16
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp38
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass_p.h1
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp82
-rw-r--r--src/declarative/qml/qdeclarativevme_p.h4
-rw-r--r--src/declarative/qml/qdeclarativevmemetaobject.cpp10
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp21
-rw-r--r--src/declarative/qml/qintrusivelist.cpp173
-rw-r--r--src/declarative/qml/qintrusivelist_p.h254
-rw-r--r--src/declarative/qml/qmetaobjectbuilder.cpp57
-rw-r--r--src/declarative/qml/qmetaobjectbuilder_p.h4
-rw-r--r--src/declarative/qml/qml.pri14
-rw-r--r--src/declarative/qml/v4/qdeclarativev4bindings.cpp1530
-rw-r--r--src/declarative/qml/v4/qdeclarativev4bindings_p.h92
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler.cpp1340
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler_p.h (renamed from src/declarative/qml/qdeclarativecompiledbindings_p.h)38
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler_p_p.h184
-rw-r--r--src/declarative/qml/v4/qdeclarativev4instruction.cpp559
-rw-r--r--src/declarative/qml/v4/qdeclarativev4instruction_p.h444
-rw-r--r--src/declarative/qml/v4/qdeclarativev4ir.cpp832
-rw-r--r--src/declarative/qml/v4/qdeclarativev4ir_p.h546
-rw-r--r--src/declarative/qml/v4/qdeclarativev4irbuilder.cpp1315
-rw-r--r--src/declarative/qml/v4/qdeclarativev4irbuilder_p.h242
-rw-r--r--src/declarative/qml/v4/qdeclarativev4program_p.h122
-rw-r--r--src/declarative/qml/v4/v4.pri17
-rw-r--r--src/declarative/scenegraph/coreapi/qsgdefaultrenderer.cpp528
-rw-r--r--src/declarative/scenegraph/coreapi/qsgdefaultrenderer_p.h96
-rw-r--r--src/declarative/scenegraph/coreapi/qsggeometry.cpp310
-rw-r--r--src/declarative/scenegraph/coreapi/qsggeometry.h254
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmaterial.cpp199
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmaterial.h141
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmatrix4x4stack.cpp380
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmatrix4x4stack.h104
-rw-r--r--src/declarative/scenegraph/coreapi/qsgmatrix4x4stack_p.h73
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnode.cpp837
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnode.h363
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnodeupdater.cpp243
-rw-r--r--src/declarative/scenegraph/coreapi/qsgnodeupdater_p.h87
-rw-r--r--src/declarative/scenegraph/coreapi/qsgrenderer.cpp544
-rw-r--r--src/declarative/scenegraph/coreapi/qsgrenderer_p.h219
-rw-r--r--src/declarative/scenegraph/qsgadaptationlayer.cpp42
-rw-r--r--src/declarative/scenegraph/qsgadaptationlayer_p.h123
-rw-r--r--src/declarative/scenegraph/qsgcontext.cpp428
-rw-r--r--src/declarative/scenegraph/qsgcontext_p.h124
-rw-r--r--src/declarative/scenegraph/qsgcontextplugin.cpp104
-rw-r--r--src/declarative/scenegraph/qsgcontextplugin_p.h81
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode.cpp95
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode_p.cpp313
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode_p.h83
-rw-r--r--src/declarative/scenegraph/qsgdefaultglyphnode_p_p.h95
-rw-r--r--src/declarative/scenegraph/qsgdefaultimagenode.cpp180
-rw-r--r--src/declarative/scenegraph/qsgdefaultimagenode_p.h90
-rw-r--r--src/declarative/scenegraph/qsgdefaultrectanglenode.cpp550
-rw-r--r--src/declarative/scenegraph/qsgdefaultrectanglenode_p.h106
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp939
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphcache_p.h158
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphnode.cpp223
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphnode_p.cpp656
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphnode_p.h93
-rw-r--r--src/declarative/scenegraph/qsgdistancefieldglyphnode_p_p.h128
-rw-r--r--src/declarative/scenegraph/qsgflashnode.cpp62
-rw-r--r--src/declarative/scenegraph/qsgflashnode_p.h69
-rw-r--r--src/declarative/scenegraph/scenegraph.pri80
-rw-r--r--src/declarative/scenegraph/util/qsgareaallocator.cpp290
-rw-r--r--src/declarative/scenegraph/util/qsgareaallocator_p.h73
-rw-r--r--src/declarative/scenegraph/util/qsgengine.cpp244
-rw-r--r--src/declarative/scenegraph/util/qsgengine.h100
-rw-r--r--src/declarative/scenegraph/util/qsgflatcolormaterial.cpp140
-rw-r--r--src/declarative/scenegraph/util/qsgflatcolormaterial.h71
-rw-r--r--src/declarative/scenegraph/util/qsgpainternode.cpp373
-rw-r--r--src/declarative/scenegraph/util/qsgpainternode_p.h140
-rw-r--r--src/declarative/scenegraph/util/qsgsimplerectnode.cpp132
-rw-r--r--src/declarative/scenegraph/util/qsgsimplerectnode.h77
-rw-r--r--src/declarative/scenegraph/util/qsgsimpletexturenode.cpp152
-rw-r--r--src/declarative/scenegraph/util/qsgsimpletexturenode.h82
-rw-r--r--src/declarative/scenegraph/util/qsgtexture.cpp400
-rw-r--r--src/declarative/scenegraph/util/qsgtexture.h132
-rw-r--r--src/declarative/scenegraph/util/qsgtexture_p.h112
-rw-r--r--src/declarative/scenegraph/util/qsgtexturematerial.cpp200
-rw-r--r--src/declarative/scenegraph/util/qsgtexturematerial.h100
-rw-r--r--src/declarative/scenegraph/util/qsgtexturematerial_p.h73
-rw-r--r--src/declarative/scenegraph/util/qsgtextureprovider.cpp65
-rw-r--r--src/declarative/scenegraph/util/qsgtextureprovider_p.h70
-rw-r--r--src/declarative/scenegraph/util/qsgvertexcolormaterial.cpp136
-rw-r--r--src/declarative/scenegraph/util/qsgvertexcolormaterial_p.h73
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp199
-rw-r--r--src/declarative/util/qdeclarativepixmapcache_p.h4
-rw-r--r--src/imports/etcprovider/etcprovider.pro19
-rw-r--r--src/imports/etcprovider/plugin.cpp72
-rw-r--r--src/imports/etcprovider/plugin.h (renamed from src/imports/particles/particles.cpp)31
-rw-r--r--src/imports/etcprovider/qetcprovider.cpp185
-rw-r--r--src/imports/etcprovider/qetcprovider.h100
-rw-r--r--src/imports/etcprovider/qmldir1
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/inputcontext/declarativeinputcontext.cpp199
-rw-r--r--src/imports/inputcontext/declarativeinputcontext.h104
-rwxr-xr-xsrc/imports/inputcontext/inputcontext.pro38
-rw-r--r--src/imports/inputcontext/inputcontextfilter.cpp352
-rw-r--r--src/imports/inputcontext/inputcontextfilter.h162
-rw-r--r--src/imports/inputcontext/inputcontextmodule.cpp413
-rw-r--r--src/imports/inputcontext/inputcontextmodule.h121
-rw-r--r--src/imports/inputcontext/plugin.cpp79
-rw-r--r--src/imports/inputcontext/qmldir1
-rw-r--r--src/imports/particles/V1/qdeclarativeparticles.cpp (renamed from src/imports/particles/qdeclarativeparticles.cpp)0
-rw-r--r--src/imports/particles/V1/qdeclarativeparticles_p.h (renamed from src/imports/particles/qdeclarativeparticles_p.h)0
-rw-r--r--src/imports/particles/angledvector.cpp66
-rw-r--r--src/imports/particles/angledvector.h133
-rw-r--r--src/imports/particles/attractoraffector.cpp66
-rw-r--r--src/imports/particles/attractoraffector.h120
-rw-r--r--src/imports/particles/coloredparticle.cpp540
-rw-r--r--src/imports/particles/coloredparticle.h254
-rw-r--r--src/imports/particles/deformableparticle.cpp438
-rw-r--r--src/imports/particles/deformableparticle.h235
-rw-r--r--src/imports/particles/directedvector.cpp93
-rw-r--r--src/imports/particles/directedvector.h190
-rw-r--r--src/imports/particles/driftaffector.cpp67
-rw-r--r--src/imports/particles/driftaffector.h104
-rw-r--r--src/imports/particles/ellipseextruder.cpp64
-rw-r--r--src/imports/particles/ellipseextruder.h86
-rw-r--r--src/imports/particles/eternalaffector.cpp60
-rw-r--r--src/imports/particles/eternalaffector.h88
-rw-r--r--src/imports/particles/followemitter.cpp196
-rw-r--r--src/imports/particles/followemitter.h168
-rw-r--r--src/imports/particles/frictionaffector.cpp59
-rw-r--r--src/imports/particles/frictionaffector.h86
-rw-r--r--src/imports/particles/gravitationalsingularityaffector.cpp179
-rw-r--r--src/imports/particles/gravitationalsingularityaffector.h121
-rw-r--r--src/imports/particles/gravityaffector.cpp77
-rw-r--r--src/imports/particles/gravityaffector.h106
-rw-r--r--src/imports/particles/killaffector.cpp57
-rw-r--r--src/imports/particles/killaffector.h68
-rw-r--r--src/imports/particles/lineextruder.cpp66
-rw-r--r--src/imports/particles/lineextruder.h77
-rw-r--r--src/imports/particles/main.cpp150
-rw-r--r--src/imports/particles/maskextruder.cpp92
-rw-r--r--src/imports/particles/maskextruder.h97
-rw-r--r--src/imports/particles/meanderaffector.cpp65
-rw-r--r--src/imports/particles/meanderaffector.h103
-rw-r--r--src/imports/particles/modelparticle.cpp287
-rw-r--r--src/imports/particles/modelparticle.h136
-rw-r--r--src/imports/particles/particle.cpp135
-rw-r--r--src/imports/particles/particle.h120
-rw-r--r--src/imports/particles/particleaffector.cpp121
-rw-r--r--src/imports/particles/particleaffector.h193
-rw-r--r--src/imports/particles/particleemitter.cpp149
-rw-r--r--src/imports/particles/particleemitter.h301
-rw-r--r--src/imports/particles/particleextruder.cpp78
-rw-r--r--src/imports/particles/particleextruder.h90
-rw-r--r--src/imports/particles/particles.pro102
-rw-r--r--src/imports/particles/particlesystem.cpp394
-rw-r--r--src/imports/particles/particlesystem.h219
-rw-r--r--src/imports/particles/pictureaffector.cpp97
-rw-r--r--src/imports/particles/pictureaffector.h97
-rw-r--r--src/imports/particles/pluginmain.h65
-rw-r--r--src/imports/particles/pointvector.cpp62
-rw-r--r--src/imports/particles/pointvector.h135
-rw-r--r--src/imports/particles/resetaffector.cpp78
-rw-r--r--src/imports/particles/resetaffector.h75
-rw-r--r--src/imports/particles/resources/ctfragment.shader11
-rw-r--r--src/imports/particles/resources/ctvertex.shader38
-rw-r--r--src/imports/particles/resources/defaultFadeInOut.pngbin0 -> 286 bytes
-rw-r--r--src/imports/particles/resources/deformablefragment.shader8
-rw-r--r--src/imports/particles/resources/deformablevertex.shader57
-rw-r--r--src/imports/particles/resources/identitytable.pngbin0 -> 90 bytes
-rw-r--r--src/imports/particles/resources/spritefragment.shader10
-rw-r--r--src/imports/particles/resources/spriteimagefragment.shader9
-rw-r--r--src/imports/particles/resources/spriteimagevertex.shader52
-rw-r--r--src/imports/particles/resources/spritevertex.shader77
-rw-r--r--src/imports/particles/resources/trailsfragment.shader8
-rw-r--r--src/imports/particles/resources/trailsvertex.shader37
-rw-r--r--src/imports/particles/speedlimitaffector.cpp77
-rw-r--r--src/imports/particles/speedlimitaffector.h89
-rw-r--r--src/imports/particles/spriteengine.cpp333
-rw-r--r--src/imports/particles/spriteengine.h155
-rw-r--r--src/imports/particles/spritegoalaffector.cpp100
-rw-r--r--src/imports/particles/spritegoalaffector.h104
-rw-r--r--src/imports/particles/spriteimage.cpp354
-rw-r--r--src/imports/particles/spriteimage.h114
-rw-r--r--src/imports/particles/spriteparticle.cpp450
-rw-r--r--src/imports/particles/spriteparticle.h99
-rw-r--r--src/imports/particles/spriteparticles.qrc16
-rw-r--r--src/imports/particles/spritestate.cpp53
-rw-r--r--src/imports/particles/spritestate.h193
-rw-r--r--src/imports/particles/swarmaffector.cpp114
-rw-r--r--src/imports/particles/swarmaffector.h116
-rw-r--r--src/imports/particles/toggleaffector.cpp59
-rw-r--r--src/imports/particles/toggleaffector.h102
-rw-r--r--src/imports/particles/trailsemitter.cpp194
-rw-r--r--src/imports/particles/trailsemitter.h105
-rw-r--r--src/imports/particles/turbulenceaffector.cpp159
-rw-r--r--src/imports/particles/turbulenceaffector.h125
-rw-r--r--src/imports/particles/varyingvector.cpp56
-rw-r--r--src/imports/particles/varyingvector.h72
-rw-r--r--src/imports/particles/wanderaffector.cpp110
-rw-r--r--src/imports/particles/wanderaffector.h136
-rw-r--r--src/imports/particles/zoneaffector.cpp68
-rw-r--r--src/imports/particles/zoneaffector.h159
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp14
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h1
-rw-r--r--tests/auto/declarative/declarative.pro24
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp42
-rw-r--r--tests/auto/declarative/geometry/geometry.pro10
-rw-r--r--tests/auto/declarative/geometry/tst_geometry.cpp181
-rw-r--r--tests/auto/declarative/node/nodes.pro10
-rw-r--r--tests/auto/declarative/node/tst_nodestest.cpp354
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp30
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/MyItem.qml4
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/import/Bar.qml2
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/importlib/sublib/Foo.qml2
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/importlib/sublib/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativedom/data/top.qml6
-rw-r--r--tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp1326
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/Scope6Nested.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleOne.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/SpecialRectangleTwo.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importFive.js3
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importFour.js9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importOne.js13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importPragmaLibrary.js9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importThree.js9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importTwo.js10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/importWithNoImports.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImport.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportPragmaLibrary.qml20
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testImportScoping.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testModuleImport.js8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimport/testScriptImport.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFive.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failFour.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failOne.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failThree.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/failTwo.qml7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/importOne.js7
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/importPragmaLibrary.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/importWithImports.js13
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testImportPragmaLibrary.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testModuleImport.js8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/jsimportfail/testScriptImport.js11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApi.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiCaching.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMajorVersionFail.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiMinorVersionFail.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/moduleApiWriting.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/realToInt.qml11
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/ScarceResourceSignalComponent.qml9
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopy.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyFromJs.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.js24
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImport.qml18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.js18
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportFail.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.js14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyImportNoBinding.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceCopyNoBinding.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceDestroyedCopy.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunction.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceFunctionFail.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceSignal.qml29
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.js48
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTest.qml14
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestMultiple.qml16
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scarceresources/scarceResourceTestPreserve.qml15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.5.qml27
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.6.qml10
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.cpp45
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h51
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp409
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/NestedComponent.qml23
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/tst_qdeclarativeinfo.cpp24
-rw-r--r--tests/auto/declarative/qdeclarativeitem/data/keynavigationtest_implicit.qml68
-rw-r--r--tests/auto/declarative/qdeclarativeitem/tst_qdeclarativeitem.cpp127
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.17.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/wrongType.17.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp15
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/qmldir2
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit1/temptest.qml14
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/Test.qml (renamed from tests/auto/declarative/qdeclarativedom/data/MyComponent.qml)1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/qmldir3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/data/implicit2/temptest2.qml8
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/tst_qdeclarativemoduleplugin.cpp49
-rw-r--r--tests/auto/declarative/qdeclarativeparticles/tst_qdeclarativeparticles.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativepathview/tst_qdeclarativepathview.cpp3
-rw-r--r--tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp14
-rw-r--r--tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp110
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp8
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml18
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/fetchException.qml6
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/logicalOr.2.qml6
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/logicalOr.qml6
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/nestedObjectAccess.qml5
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/nullQObject.qml7
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml10
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml11
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml18
-rw-r--r--tests/auto/declarative/qdeclarativev4/data/unnecessaryReeval.qml7
-rw-r--r--tests/auto/declarative/qdeclarativev4/qdeclarativev4.pro18
-rw-r--r--tests/auto/declarative/qdeclarativev4/testtypes.cpp49
-rw-r--r--tests/auto/declarative/qdeclarativev4/testtypes.h83
-rw-r--r--tests/auto/declarative/qdeclarativev4/tst_qdeclarativev4.cpp226
-rw-r--r--tests/auto/declarative/qdeclarativeview/tst_qdeclarativeview.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp2
-rw-r--r--tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp22
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.0.pngbin263 -> 343 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.1.pngbin280 -> 349 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.2.pngbin270 -> 345 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.3.pngbin280 -> 349 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.4.pngbin280 -> 353 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.5.pngbin283 -> 351 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.6.pngbin281 -> 349 bytes
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/dynamic.qml784
-rw-r--r--tests/auto/declarative/qmlvisual/qdeclarativepositioners/dynamic.qml13
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/colors.gifbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/colors.qml5
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/hearts.gifbin0 -> 6524 bytes
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/hearts.qml6
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/qmldir1
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/qtbug-16520.qml17
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/stickman.gifbin0 -> 164923 bytes
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/stickman.qml5
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/stickmanerror1.qml6
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/stickmanpause.qml7
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/stickmanscaled.qml7
-rw-r--r--tests/auto/declarative/qsganimatedimage/data/stickmanstopped.qml6
-rw-r--r--tests/auto/declarative/qsganimatedimage/qsganimatedimage.pro16
-rw-r--r--tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp387
-rw-r--r--tests/auto/declarative/qsgborderimage/data/colors-round-remote.sci7
-rw-r--r--tests/auto/declarative/qsgborderimage/data/colors-round.sci7
-rw-r--r--tests/auto/declarative/qsgborderimage/data/colors.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qsgborderimage/data/heart200.pngbin0 -> 7943 bytes
-rw-r--r--tests/auto/declarative/qsgborderimage/data/invalid.sci7
-rw-r--r--tests/auto/declarative/qsgborderimage/qsgborderimage.pro17
-rw-r--r--tests/auto/declarative/qsgborderimage/tst_qsgborderimage.cpp426
-rw-r--r--tests/auto/declarative/qsgcanvas/qsgcanvas.pro7
-rw-r--r--tests/auto/declarative/qsgcanvas/tst_qsgcanvas.cpp437
-rw-r--r--tests/auto/declarative/qsgflickable/data/disabledcontent.qml8
-rw-r--r--tests/auto/declarative/qsgflickable/data/flickable01.qml4
-rw-r--r--tests/auto/declarative/qsgflickable/data/flickable02.qml14
-rw-r--r--tests/auto/declarative/qsgflickable/data/flickable03.qml14
-rw-r--r--tests/auto/declarative/qsgflickable/data/flickable04.qml22
-rw-r--r--tests/auto/declarative/qsgflickable/data/flickableqgraphicswidget.qml7
-rw-r--r--tests/auto/declarative/qsgflickable/data/nestedPressDelay.qml33
-rw-r--r--tests/auto/declarative/qsgflickable/data/resize.qml27
-rw-r--r--tests/auto/declarative/qsgflickable/data/wheel.qml25
-rw-r--r--tests/auto/declarative/qsgflickable/qsgflickable.pro16
-rw-r--r--tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp450
-rw-r--r--tests/auto/declarative/qsgflipable/data/crash.qml9
-rw-r--r--tests/auto/declarative/qsgflipable/data/flipable-abort.qml10
-rw-r--r--tests/auto/declarative/qsgflipable/data/test-flipable.qml9
-rw-r--r--tests/auto/declarative/qsgflipable/qsgflipable.pro16
-rw-r--r--tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp143
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/chain.qml28
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/forceActiveFocus.qml26
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/forcefocus.qml81
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/qtBug13380.qml24
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/signalEmission.qml33
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/test.qml77
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/test2.qml39
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/test3.qml52
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/test4.qml76
-rw-r--r--tests/auto/declarative/qsgfocusscope/data/test5.qml84
-rw-r--r--tests/auto/declarative/qsgfocusscope/qsgfocusscope.pro13
-rw-r--r--tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp540
-rw-r--r--tests/auto/declarative/qsggridview/data/attachedSignals.qml27
-rw-r--r--tests/auto/declarative/qsggridview/data/displaygrid.qml39
-rw-r--r--tests/auto/declarative/qsggridview/data/footer.qml40
-rw-r--r--tests/auto/declarative/qsggridview/data/gridview-enforcerange.qml58
-rw-r--r--tests/auto/declarative/qsggridview/data/gridview-initCurrent.qml52
-rw-r--r--tests/auto/declarative/qsggridview/data/gridview-noCurrent.qml52
-rw-r--r--tests/auto/declarative/qsggridview/data/gridview1.qml65
-rw-r--r--tests/auto/declarative/qsggridview/data/gridview2.qml26
-rw-r--r--tests/auto/declarative/qsggridview/data/gridview3.qml6
-rw-r--r--tests/auto/declarative/qsggridview/data/header.qml40
-rw-r--r--tests/auto/declarative/qsggridview/data/manual-highlight.qml48
-rw-r--r--tests/auto/declarative/qsggridview/data/mirroring.qml43
-rw-r--r--tests/auto/declarative/qsggridview/data/propertychangestest.qml69
-rw-r--r--tests/auto/declarative/qsggridview/data/setindex.qml29
-rw-r--r--tests/auto/declarative/qsggridview/qsggridview.pro (renamed from tests/auto/declarative/qdeclarativedom/qdeclarativedom.pro)2
-rw-r--r--tests/auto/declarative/qsggridview/tst_qsggridview.cpp2171
-rw-r--r--tests/auto/declarative/qsgimage/data/aspectratio.qml6
-rw-r--r--tests/auto/declarative/qsgimage/data/big.jpegbin0 -> 1700081 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/big256.pngbin0 -> 3566 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/colors.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/colors1.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/green.pngbin0 -> 314 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/heart-win32.pngbin0 -> 12621 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/heart.pngbin0 -> 12577 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/heart.svg55
-rw-r--r--tests/auto/declarative/qsgimage/data/heart200-win32.pngbin0 -> 8062 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/heart200.pngbin0 -> 8063 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/qtbug_16389.qml30
-rw-r--r--tests/auto/declarative/qsgimage/data/rect.pngbin0 -> 171 bytes
-rw-r--r--tests/auto/declarative/qsgimage/data/tiling.qml16
-rw-r--r--tests/auto/declarative/qsgimage/qsgimage.pro17
-rw-r--r--tests/auto/declarative/qsgimage/tst_qsgimage.cpp776
-rw-r--r--tests/auto/declarative/qsgitem/qsgitem.pro7
-rw-r--r--tests/auto/declarative/qsgitem/tst_qsgitem.cpp787
-rw-r--r--tests/auto/declarative/qsgitem2/data/childrenProperty.qml14
-rw-r--r--tests/auto/declarative/qsgitem2/data/childrenRect.qml27
-rw-r--r--tests/auto/declarative/qsgitem2/data/childrenRectBug.qml23
-rw-r--r--tests/auto/declarative/qsgitem2/data/childrenRectBug2.qml53
-rw-r--r--tests/auto/declarative/qsgitem2/data/childrenRectBug3.qml15
-rw-r--r--tests/auto/declarative/qsgitem2/data/implicitsize.qml19
-rw-r--r--tests/auto/declarative/qsgitem2/data/keynavigationtest.qml87
-rw-r--r--tests/auto/declarative/qsgitem2/data/keynavigationtest_implicit.qml68
-rw-r--r--tests/auto/declarative/qsgitem2/data/keyspriority.qml9
-rw-r--r--tests/auto/declarative/qsgitem2/data/keystest.qml24
-rw-r--r--tests/auto/declarative/qsgitem2/data/layoutmirroring.qml54
-rw-r--r--tests/auto/declarative/qsgitem2/data/mapCoordinates.qml43
-rw-r--r--tests/auto/declarative/qsgitem2/data/mouseFocus.qml20
-rw-r--r--tests/auto/declarative/qsgitem2/data/propertychanges.qml10
-rw-r--r--tests/auto/declarative/qsgitem2/data/qtbug_16871.qml5
-rw-r--r--tests/auto/declarative/qsgitem2/data/resourcesProperty.qml21
-rw-r--r--tests/auto/declarative/qsgitem2/data/transformCrash.qml13
-rw-r--r--tests/auto/declarative/qsgitem2/qsgitem.pro16
-rw-r--r--tests/auto/declarative/qsgitem2/tst_qsgitem.cpp1322
-rw-r--r--tests/auto/declarative/qsglistview/data/attachedSignals.qml24
-rw-r--r--tests/auto/declarative/qsglistview/data/displaylist.qml50
-rw-r--r--tests/auto/declarative/qsglistview/data/footer.qml38
-rw-r--r--tests/auto/declarative/qsglistview/data/header.qml38
-rw-r--r--tests/auto/declarative/qsglistview/data/header1.qml33
-rw-r--r--tests/auto/declarative/qsglistview/data/headerfooter.qml26
-rw-r--r--tests/auto/declarative/qsglistview/data/itemlist.qml43
-rw-r--r--tests/auto/declarative/qsglistview/data/listview-enforcerange.qml55
-rw-r--r--tests/auto/declarative/qsglistview/data/listview-initCurrent.qml51
-rw-r--r--tests/auto/declarative/qsglistview/data/listview-noCurrent.qml50
-rw-r--r--tests/auto/declarative/qsglistview/data/listview-sections.qml64
-rw-r--r--tests/auto/declarative/qsglistview/data/listview-sections_delegate.qml69
-rw-r--r--tests/auto/declarative/qsglistview/data/listviewtest.qml132
-rw-r--r--tests/auto/declarative/qsglistview/data/manual-highlight.qml47
-rw-r--r--tests/auto/declarative/qsglistview/data/propertychangestest.qml71
-rw-r--r--tests/auto/declarative/qsglistview/data/qtbug14821.qml31
-rw-r--r--tests/auto/declarative/qsglistview/data/qtbug16037.qml37
-rw-r--r--tests/auto/declarative/qsglistview/data/rightToLeft.qml42
-rw-r--r--tests/auto/declarative/qsglistview/data/sizelessthan1.qml26
-rw-r--r--tests/auto/declarative/qsglistview/data/strictlyenforcerange.qml29
-rw-r--r--tests/auto/declarative/qsglistview/incrementalmodel.cpp89
-rw-r--r--tests/auto/declarative/qsglistview/incrementalmodel.h68
-rw-r--r--tests/auto/declarative/qsglistview/qsglistview.pro16
-rw-r--r--tests/auto/declarative/qsglistview/tst_qsglistview.cpp2698
-rw-r--r--tests/auto/declarative/qsgloader/data/AnchoredLoader.qml14
-rw-r--r--tests/auto/declarative/qsgloader/data/BlueRect.qml8
-rw-r--r--tests/auto/declarative/qsgloader/data/CreationContextLoader.qml15
-rw-r--r--tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml5
-rw-r--r--tests/auto/declarative/qsgloader/data/GreenRect.qml7
-rw-r--r--tests/auto/declarative/qsgloader/data/NoResize.qml8
-rw-r--r--tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml9
-rw-r--r--tests/auto/declarative/qsgloader/data/QTBUG_16928.qml23
-rw-r--r--tests/auto/declarative/qsgloader/data/QTBUG_17114.qml18
-rw-r--r--tests/auto/declarative/qsgloader/data/Rect120x60.qml6
-rw-r--r--tests/auto/declarative/qsgloader/data/SetSourceComponent.qml9
-rw-r--r--tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml7
-rw-r--r--tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml5
-rw-r--r--tests/auto/declarative/qsgloader/data/SizeToItem.qml5
-rw-r--r--tests/auto/declarative/qsgloader/data/SizeToLoader.qml6
-rw-r--r--tests/auto/declarative/qsgloader/data/VmeError.qml7
-rw-r--r--tests/auto/declarative/qsgloader/data/crash.qml14
-rw-r--r--tests/auto/declarative/qsgloader/data/creationContext.qml8
-rw-r--r--tests/auto/declarative/qsgloader/data/differentorigin.qml3
-rw-r--r--tests/auto/declarative/qsgloader/data/implicitSize.qml28
-rw-r--r--tests/auto/declarative/qsgloader/data/nonItem.qml5
-rw-r--r--tests/auto/declarative/qsgloader/data/qmldir1
-rw-r--r--tests/auto/declarative/qsgloader/data/sameorigin-load.qml3
-rw-r--r--tests/auto/declarative/qsgloader/data/sameorigin.qml3
-rw-r--r--tests/auto/declarative/qsgloader/data/vmeErrors.qml6
-rw-r--r--tests/auto/declarative/qsgloader/qsgloader.pro19
-rw-r--r--tests/auto/declarative/qsgloader/tst_qsgloader.cpp559
-rw-r--r--tests/auto/declarative/qsgmousearea/data/clickThrough.qml23
-rw-r--r--tests/auto/declarative/qsgmousearea/data/clickThrough2.qml32
-rw-r--r--tests/auto/declarative/qsgmousearea/data/clickandhold.qml13
-rw-r--r--tests/auto/declarative/qsgmousearea/data/clicktwice.qml16
-rw-r--r--tests/auto/declarative/qsgmousearea/data/doubleclick.qml16
-rw-r--r--tests/auto/declarative/qsgmousearea/data/dragging.qml28
-rw-r--r--tests/auto/declarative/qsgmousearea/data/dragproperties.qml28
-rw-r--r--tests/auto/declarative/qsgmousearea/data/dragreset.qml28
-rw-r--r--tests/auto/declarative/qsgmousearea/data/hoverPosition.qml17
-rw-r--r--tests/auto/declarative/qsgmousearea/data/pressedOrdering.qml28
-rw-r--r--tests/auto/declarative/qsgmousearea/data/preventstealing.qml24
-rw-r--r--tests/auto/declarative/qsgmousearea/data/rejectEvent.qml28
-rw-r--r--tests/auto/declarative/qsgmousearea/data/updateMousePosOnClick.qml20
-rw-r--r--tests/auto/declarative/qsgmousearea/data/updateMousePosOnResize.qml38
-rw-r--r--tests/auto/declarative/qsgmousearea/qsgmousearea.pro17
-rw-r--r--tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp705
-rw-r--r--tests/auto/declarative/qsgpathview/data/closedPath.qml24
-rw-r--r--tests/auto/declarative/qsgpathview/data/datamodel.qml37
-rw-r--r--tests/auto/declarative/qsgpathview/data/displaypath.qml59
-rw-r--r--tests/auto/declarative/qsgpathview/data/dragpath.qml19
-rw-r--r--tests/auto/declarative/qsgpathview/data/emptymodel.qml5
-rw-r--r--tests/auto/declarative/qsgpathview/data/openPath.qml10
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathUpdate.qml18
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathUpdateOnStartChanged.qml38
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathtest.qml14
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathview0.qml83
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathview1.qml4
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathview2.qml57
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathview3.qml59
-rw-r--r--tests/auto/declarative/qsgpathview/data/pathview_package.qml88
-rw-r--r--tests/auto/declarative/qsgpathview/data/propertychanges.qml116
-rw-r--r--tests/auto/declarative/qsgpathview/data/treemodel.qml19
-rw-r--r--tests/auto/declarative/qsgpathview/data/undefinedpath.qml17
-rw-r--r--tests/auto/declarative/qsgpathview/data/vdm.qml28
-rw-r--r--tests/auto/declarative/qsgpathview/qsgpathview.pro16
-rw-r--r--tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp1058
-rw-r--r--tests/auto/declarative/qsgpincharea/data/pinchproperties.qml46
-rw-r--r--tests/auto/declarative/qsgpincharea/qsgpincharea.pro16
-rw-r--r--tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp311
-rw-r--r--tests/auto/declarative/qsgpositioners/data/flow-testimplicitsize.qml19
-rw-r--r--tests/auto/declarative/qsgpositioners/data/flowtest-toptobottom.qml44
-rw-r--r--tests/auto/declarative/qsgpositioners/data/flowtest.qml43
-rw-r--r--tests/auto/declarative/qsgpositioners/data/grid-animated.qml64
-rw-r--r--tests/auto/declarative/qsgpositioners/data/grid-spacing.qml41
-rw-r--r--tests/auto/declarative/qsgpositioners/data/grid-toptobottom.qml41
-rw-r--r--tests/auto/declarative/qsgpositioners/data/gridtest.qml42
-rw-r--r--tests/auto/declarative/qsgpositioners/data/gridzerocolumns.qml40
-rw-r--r--tests/auto/declarative/qsgpositioners/data/horizontal-animated.qml44
-rw-r--r--tests/auto/declarative/qsgpositioners/data/horizontal-spacing.qml31
-rw-r--r--tests/auto/declarative/qsgpositioners/data/horizontal.qml29
-rw-r--r--tests/auto/declarative/qsgpositioners/data/propertychangestest.qml39
-rw-r--r--tests/auto/declarative/qsgpositioners/data/repeatertest.qml38
-rw-r--r--tests/auto/declarative/qsgpositioners/data/vertical-animated.qml41
-rw-r--r--tests/auto/declarative/qsgpositioners/data/vertical-spacing.qml28
-rw-r--r--tests/auto/declarative/qsgpositioners/data/vertical.qml27
-rw-r--r--tests/auto/declarative/qsgpositioners/qsgpositioners.pro15
-rw-r--r--tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp1268
-rw-r--r--tests/auto/declarative/qsgrepeater/data/intmodel.qml29
-rw-r--r--tests/auto/declarative/qsgrepeater/data/itemlist.qml68
-rw-r--r--tests/auto/declarative/qsgrepeater/data/modelChanged.qml26
-rw-r--r--tests/auto/declarative/qsgrepeater/data/objlist.qml21
-rw-r--r--tests/auto/declarative/qsgrepeater/data/properties.qml11
-rw-r--r--tests/auto/declarative/qsgrepeater/data/repeater1.qml28
-rw-r--r--tests/auto/declarative/qsgrepeater/data/repeater2.qml36
-rw-r--r--tests/auto/declarative/qsgrepeater/qsgrepeater.pro15
-rw-r--r--tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp697
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments.qml41
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_cb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_cc.pngbin0 -> 556 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_ct.pngbin0 -> 533 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_lb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_lc.pngbin0 -> 535 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_lt.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_rb.pngbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_rc.pngbin0 -> 559 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/alignments_rt.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/embeddedImagesLocal.qml5
-rw-r--r--tests/auto/declarative/qsgtext/data/embeddedImagesLocalError.qml5
-rw-r--r--tests/auto/declarative/qsgtext/data/embeddedImagesRemote.qml5
-rw-r--r--tests/auto/declarative/qsgtext/data/embeddedImagesRemoteError.qml5
-rw-r--r--tests/auto/declarative/qsgtext/data/horizontalAlignment_RightToLeft.qml23
-rw-r--r--tests/auto/declarative/qsgtext/data/http/exists.pngbin0 -> 2738 bytes
-rw-r--r--tests/auto/declarative/qsgtext/data/lineCount.qml15
-rw-r--r--tests/auto/declarative/qsgtext/data/lineHeight.qml15
-rw-r--r--tests/auto/declarative/qsgtext/data/qtbug_14734.qml10
-rw-r--r--tests/auto/declarative/qsgtext/data/rotated.qml18
-rw-r--r--tests/auto/declarative/qsgtext/qsgtext.pro21
-rw-r--r--tests/auto/declarative/qsgtext/tst_qsgtext.cpp1377
-rw-r--r--tests/auto/declarative/qsgtextedit/data/CursorRect.qml8
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments.qml41
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_cb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_cc.pngbin0 -> 556 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_ct.pngbin0 -> 533 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_lb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_lc.pngbin0 -> 535 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_lt.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_rb.pngbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_rc.pngbin0 -> 559 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/alignments_rt.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qsgtextedit/data/cursorTest.qml8
-rw-r--r--tests/auto/declarative/qsgtextedit/data/cursorVisible.qml6
-rw-r--r--tests/auto/declarative/qsgtextedit/data/geometrySignals.qml12
-rw-r--r--tests/auto/declarative/qsgtextedit/data/horizontalAlignment_RightToLeft.qml23
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/ErrItem.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/NormItem.qml6
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/cursorHttpTest.qml22
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail1.qml18
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail2.qml18
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestPass.qml18
-rw-r--r--tests/auto/declarative/qsgtextedit/data/http/qmldir4
-rw-r--r--tests/auto/declarative/qsgtextedit/data/httpfail/FailItem.qml5
-rw-r--r--tests/auto/declarative/qsgtextedit/data/httpslow/WaitItem.qml5
-rw-r--r--tests/auto/declarative/qsgtextedit/data/inputContext.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/inputMethodEvent.qml5
-rw-r--r--tests/auto/declarative/qsgtextedit/data/inputmethodhints.qml6
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselection_default.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselection_false.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselection_false_words.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselection_true.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselection_true_words.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselectionmode_characters.qml8
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselectionmode_default.qml7
-rw-r--r--tests/auto/declarative/qsgtextedit/data/mouseselectionmode_words.qml8
-rw-r--r--tests/auto/declarative/qsgtextedit/data/navigation.qml24
-rw-r--r--tests/auto/declarative/qsgtextedit/data/openInputPanel.qml6
-rw-r--r--tests/auto/declarative/qsgtextedit/data/positionAt.qml9
-rw-r--r--tests/auto/declarative/qsgtextedit/data/readOnly.qml12
-rw-r--r--tests/auto/declarative/qsgtextedit/qsgtextedit.pro14
-rw-r--r--tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp2388
-rw-r--r--tests/auto/declarative/qsgtextinput/data/cursorTest.qml8
-rw-r--r--tests/auto/declarative/qsgtextinput/data/cursorVisible.qml6
-rw-r--r--tests/auto/declarative/qsgtextinput/data/echoMode.qml11
-rw-r--r--tests/auto/declarative/qsgtextinput/data/geometrySignals.qml12
-rw-r--r--tests/auto/declarative/qsgtextinput/data/halign_center.pngbin0 -> 293 bytes
-rw-r--r--tests/auto/declarative/qsgtextinput/data/halign_left.pngbin0 -> 291 bytes
-rw-r--r--tests/auto/declarative/qsgtextinput/data/halign_right.pngbin0 -> 292 bytes
-rw-r--r--tests/auto/declarative/qsgtextinput/data/horizontalAlignment.qml22
-rw-r--r--tests/auto/declarative/qsgtextinput/data/horizontalAlignment_RightToLeft.qml23
-rw-r--r--tests/auto/declarative/qsgtextinput/data/inputContext.qml8
-rw-r--r--tests/auto/declarative/qsgtextinput/data/inputMethodEvent.qml5
-rw-r--r--tests/auto/declarative/qsgtextinput/data/inputmethods.qml7
-rw-r--r--tests/auto/declarative/qsgtextinput/data/masks.qml7
-rw-r--r--tests/auto/declarative/qsgtextinput/data/maxLength.qml7
-rw-r--r--tests/auto/declarative/qsgtextinput/data/mouseselection_true.qml7
-rw-r--r--tests/auto/declarative/qsgtextinput/data/mouseselectionmode_characters.qml8
-rw-r--r--tests/auto/declarative/qsgtextinput/data/mouseselectionmode_default.qml7
-rw-r--r--tests/auto/declarative/qsgtextinput/data/mouseselectionmode_words.qml8
-rw-r--r--tests/auto/declarative/qsgtextinput/data/navigation.qml24
-rw-r--r--tests/auto/declarative/qsgtextinput/data/openInputPanel.qml6
-rw-r--r--tests/auto/declarative/qsgtextinput/data/positionAt.qml8
-rw-r--r--tests/auto/declarative/qsgtextinput/data/preeditAutoScroll.qml7
-rw-r--r--tests/auto/declarative/qsgtextinput/data/readOnly.qml12
-rw-r--r--tests/auto/declarative/qsgtextinput/data/validators.qml22
-rw-r--r--tests/auto/declarative/qsgtextinput/qsgtextinput.pro14
-rw-r--r--tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp2471
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml18
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml19
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml19
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml19
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml10
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml10
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml11
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/qsgvisualdatamodel.pro16
-rw-r--r--tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp531
-rw-r--r--tests/benchmarks/declarative/declarative.pro1
-rw-r--r--tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicFour.qml78
-rw-r--r--tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicOne.qml56
-rw-r--r--tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicThree.qml61
-rw-r--r--tests/benchmarks/declarative/holistic/data/dynamicTargets/DynamicTwo.qml68
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Mlbsi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Mldsi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Mlsi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/ModuleBm.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Msbsi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Msdsi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Mssi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/PragmaBm.qml55
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/PragmaModuleBm.qml51
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Slsi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/Sssi.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi.js133
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi1.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi10.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi11.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi12.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi13.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi14.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi15.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi2.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi3.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi4.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi5.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi6.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi7.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi8.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlbsi9.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi.js105
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi1.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi10.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi11.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi12.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi13.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi14.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi15.js104
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi2.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi3.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi4.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi5.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi6.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi7.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi8.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mldsi9.js107
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mlsi.js138
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/moduleBm.js109
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi.js79
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi1.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi10.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi11.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi12.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi13.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi14.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi15.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi2.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi3.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi4.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi5.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi6.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi7.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi8.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msbsi9.js53
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi.js51
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi1.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi10.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi11.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi12.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi13.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi14.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi15.js49
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi2.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi3.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi4.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi5.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi6.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi7.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi8.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/msdsi9.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/mssi.js84
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmOne.js50
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/pragmaBmTwo.js50
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/pragmaLib.js119
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/pragmaModuleBm.js57
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/slsi.js108
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsImports/sssi.js52
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsTargets/JsOne.qml61
-rw-r--r--tests/benchmarks/declarative/holistic/data/jsTargets/JsTwo.qml118
-rw-r--r--tests/benchmarks/declarative/holistic/data/largeTargets/gridview-example.qml91
-rw-r--r--tests/benchmarks/declarative/holistic/data/largeTargets/layoutdirection.qml151
-rw-r--r--tests/benchmarks/declarative/holistic/data/largeTargets/mousearea-example.qml112
-rw-r--r--tests/benchmarks/declarative/holistic/data/resolutionTargets/ResolveOne.qml111
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToJs.qml52
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/CppToQml.qml48
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEight.qml54
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppEleven.qml57
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFive.qml54
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppFour.qml55
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppNine.qml56
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppOne.qml55
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSeven.qml54
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppSix.qml54
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTen.qml56
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppThree.qml55
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/JsToCppTwo.qml55
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceOne.qml57
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/ScarceTwo.qml52
-rw-r--r--tests/benchmarks/declarative/holistic/data/scopeSwitching/cppToJs.js49
-rw-r--r--tests/benchmarks/declarative/holistic/data/smallTargets/SmallFour.qml49
-rw-r--r--tests/benchmarks/declarative/holistic/data/smallTargets/SmallOne.qml51
-rw-r--r--tests/benchmarks/declarative/holistic/data/smallTargets/SmallThree.qml51
-rw-r--r--tests/benchmarks/declarative/holistic/data/smallTargets/SmallTwo.qml51
-rw-r--r--tests/benchmarks/declarative/holistic/holistic.pro19
-rw-r--r--tests/benchmarks/declarative/holistic/testtypes.cpp98
-rw-r--r--tests/benchmarks/declarative/holistic/testtypes.h355
-rw-r--r--tests/benchmarks/declarative/holistic/tst_holistic.cpp612
-rw-r--r--tests/benchmarks/declarative/script/data/enums.qml51
-rw-r--r--tests/benchmarks/declarative/script/data/namespacedEnums.qml52
-rw-r--r--tests/benchmarks/declarative/script/data/script.js1
-rw-r--r--tests/benchmarks/declarative/script/data/script2.js2
-rw-r--r--tests/benchmarks/declarative/script/data/scriptCall.qml54
-rw-r--r--tests/benchmarks/declarative/script/tst_script.cpp107
-rw-r--r--tools/qmlplugindump/Info.plist16
-rw-r--r--tools/qmlplugindump/main.cpp598
-rw-r--r--tools/qmlplugindump/qmlplugindump.pro20
-rw-r--r--tools/qmlplugindump/qmlstreamwriter.cpp183
-rw-r--r--tools/qmlplugindump/qmlstreamwriter.h79
-rw-r--r--tools/qmlscene/main.cpp574
-rw-r--r--tools/qmlscene/qmlscene.pro20
-rw-r--r--tools/qmlviewer/main.cpp7
-rw-r--r--tools/qmlviewer/qmlruntime.cpp1
-rw-r--r--tools/tools.pro2
1061 files changed, 125853 insertions, 7482 deletions
diff --git a/demos/declarative/plasmapatrol/PlasmaPatrol.qmlproject b/demos/declarative/plasmapatrol/PlasmaPatrol.qmlproject
new file mode 100644
index 0000000000..53f5ecb8d2
--- /dev/null
+++ b/demos/declarative/plasmapatrol/PlasmaPatrol.qmlproject
@@ -0,0 +1,18 @@
+/* File generated by QtCreator */
+
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ "../exampleplugin" ]
+}
diff --git a/demos/declarative/plasmapatrol/TODO b/demos/declarative/plasmapatrol/TODO
new file mode 100644
index 0000000000..ef9d21a73d
--- /dev/null
+++ b/demos/declarative/plasmapatrol/TODO
@@ -0,0 +1,10 @@
+Realistic Tasks:
+Particle explosions on ship death.
+Better help text (both content and styled a little nicer).
+Hardpoint help showing them firing across the screen.
+Endless Demo Mode
+
+Nice-but-i-doubt-it-will-get-done Tasks:
+Particle Text for the winner.
+Particle-based buttons.
+Single player mode that is challenges (known opponents) to master the game with and earn achievements (in addition to 'skirmish').
diff --git a/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml b/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml
new file mode 100644
index 0000000000..8d36cdfb13
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/BlasterHardpoint.qml
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ property variant target: {"y": -90, "x":12}
+ property Item targetObj: container
+ property Item hardpoint: container
+ property ParticleSystem system
+ property int blasts: 16
+ property int bonusBlasts: 12
+ property bool show: true
+
+ width: 24
+ height: 24
+ TrailEmitter{
+ id: visualization
+ particle: "blaster"
+ system: container.system
+ emitting: show
+ anchors.fill: parent
+ shape: Ellipse{}
+ speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
+ particleDuration: 1000
+ particlesPerSecond: 64
+
+ particleSize: 24
+ particleSizeVariation: 24
+ particleEndSize: 0
+ }
+
+ property int blastsLeft: 0
+ function fireAt(targetArg, container){
+ target = container.mapFromItem(targetArg, targetArg.width/2, targetArg.height/2);
+ targetObj = targetArg;
+ hardpoint = container;
+ blastsLeft = blasts;
+ rofTimer.repeat = true;
+ rofTimer.start();
+ }
+ Timer{
+ id: rofTimer
+ interval: 30;//Has to be greater than 1 frame or they stack up
+ running: false
+ repeat: false
+ onTriggered:{
+ if(targetObj.hp <= 0)
+ return;
+ //TODO: calculate hit and damage at target, which must be a Ship
+ var hit;
+ if(blastsLeft >= bonusBlasts)
+ hit = Math.random() > targetObj.dodge;
+ else
+ hit = false; //purely aesthetic shots, because the damage isn't that fine grained
+ if(hit == true){
+ switch(targetObj.shipType){
+ case 1: hardpoint.damageDealt += 4; break;
+ case 2: hardpoint.damageDealt += 5; break;
+ case 3: hardpoint.damageDealt += 1; break;
+ default: hardpoint.damageDealt += 100;
+ }
+ }
+ blastVector.targetX = target.x;
+ blastVector.targetY = target.y;
+ if(!hit){//TODO: Actual targetVariation
+ blastVector.targetX += (128 * Math.random() - 64);
+ blastVector.targetY += (128 * Math.random() - 64);
+ }
+ emitter.burst(1);
+ blastsLeft--;
+ if(!blastsLeft)
+ rofTimer.repeat = false;
+ }
+ }
+ TrailEmitter{
+ id: emitter
+ particle: "blaster"
+ emitting: false
+ system: container.system
+ anchors.centerIn: parent
+
+ particleDuration: 1000
+ particlesPerSecond: 16
+ maxParticles: blasts
+ particleSize: 24
+ particleEndSize:16
+ particleSizeVariation: 8
+ speed: DirectedVector{
+ id: blastVector
+ targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
+ }
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/Button.qml b/demos/declarative/plasmapatrol/content/Button.qml
new file mode 100644
index 0000000000..0d810e3b75
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/Button.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+//TODO: Add particles to this component too
+Rectangle{
+ id: container
+ property alias text: txt.text
+ signal clicked
+ //color: "lightsteelblue"
+ gradient: Gradient{
+ GradientStop{ position: 0.0; color: "lightsteelblue" }
+ GradientStop{ position: 1.0; color: "steelblue" }
+ }
+ height: 64
+ radius: 16
+ width: 128
+ Text{
+ id: txt
+ anchors.centerIn: parent
+ font.pixelSize: 24
+ color: "white"
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/CannonHardpoint.qml b/demos/declarative/plasmapatrol/content/CannonHardpoint.qml
new file mode 100644
index 0000000000..d9a307cc64
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/CannonHardpoint.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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ property variant target: {"y": -90, "x":12}
+ property ParticleSystem system
+ property bool show: true
+
+ width: 24
+ height: 24
+ TrailEmitter{
+ id: visualization
+ particle: "cannon"
+ emitting: container.show
+ system: container.system
+ anchors.centerIn: parent
+ particleDuration: 2000
+ particlesPerSecond: 1
+
+ particleSize: 4
+ particleEndSize: 0
+ }
+
+ function fireAt(targetArg, hardpoint){
+ target = container.mapFromItem(targetArg, targetArg.width/2, targetArg.height/2);
+ if(container.hp <= 0 || targetArg.hp <= 0)
+ return;
+ //TODO: calculate hit and damage at target, which must be a Ship
+ var hit = Math.random() > targetArg.dodge
+ if(hit){
+ switch(targetArg.shipType){
+ case 1: hardpoint.damageDealt += 8; break;
+ case 2: hardpoint.damageDealt += 10; break;
+ case 3: hardpoint.damageDealt += 16; break;
+ default: hardpoint.damageDealt += 1000;
+ }
+ }
+ emitter.burst(1);
+ }
+ TrailEmitter{
+ id: emitter
+ particle: "cannon"
+ emitting: false
+ system: container.system
+ anchors.centerIn: parent
+
+ particleDuration: 1000
+ particlesPerSecond: 1
+ particleSize: 8
+ particleEndSize: 4
+ speed: DirectedVector{
+ id: blastVector
+ targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
+ }
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/ChoiceBox.qml b/demos/declarative/plasmapatrol/content/ChoiceBox.qml
new file mode 100644
index 0000000000..6bdc4288ee
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/ChoiceBox.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item{
+ id: container
+ width: 360
+ height: 160
+ property ParticleSystem system
+ Ship{
+ id: nully
+ system: system
+ }
+ property Item target: nully
+ /*
+ Component.onCompleted:{
+ container.target.shipType = 1
+ container.target.gunType = 1
+ }
+ */
+ Row{
+ anchors.horizontalCenter: parent.horizontalCenter
+ height: parent.height
+ spacing: 8
+ Button{
+ width: 80
+ height: 80
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Cycle\nShip"
+ onClicked: {
+ var nextVal = container.target.shipType;
+ if(nextVal == 3)
+ nextVal = 1;
+ else
+ nextVal++;
+ container.target.shipType = nextVal;
+ }
+ }
+ Item{
+ width: 128
+ height: 128
+ anchors.verticalCenter: parent.verticalCenter
+ Ship{
+ hp: 20
+ anchors.centerIn: parent
+ shipType: container.target.shipType
+ gunType: container.target.gunType
+ system: container.system
+ }
+ }
+ Button{
+ width: 80
+ height: 80
+ anchors.verticalCenter: parent.verticalCenter
+ text: "Cycle\nGun"
+ onClicked: {
+ var nextVal = container.target.gunType;
+ if(nextVal == 3)
+ nextVal = 1;
+ else
+ nextVal++;
+ container.target.gunType = nextVal;
+ }
+ }
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/Cruiser.qml b/demos/declarative/plasmapatrol/content/Cruiser.qml
new file mode 100644
index 0000000000..8b8073328e
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/Cruiser.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ property int maxHP: 100
+ property int hp: maxHP
+ property real initialDodge: 0.01
+ property real dodge: initialDodge
+ onHpChanged: if(hp <= 0) target = container;
+ property ParticleSystem system//TODO: Ship abstraction
+ property Item target: container
+ property string shipParticle: "default"//Per team colors?
+ property int gunType: 0
+ width: 128
+ height: 128
+ TrailEmitter{
+ //TODO: Cooler would be an 'orbiting' affector
+ //TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles
+ system: container.system
+ particle: container.shipParticle
+ anchors.centerIn: parent
+ width: 64
+ height: 64
+ shape: Ellipse{}
+
+ particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0
+ particleDuration: 2400
+ maxParticles: (maxHP * 1 + 20)*2.4
+
+ particleSize: 48
+ particleSizeVariation: 16
+ particleEndSize: 16
+
+ speed: AngleVector{angleVariation:360; magnitudeVariation: 32}
+ }
+ TrailEmitter{
+ system: container.system
+ particle: "cruiserArmor"
+ anchors.fill: parent
+ shape: Ellipse{ fill: false }
+ emitting: hp>0
+
+ particlesPerSecond: 16
+ particleDuration: 2000
+
+ particleSize: 48
+ particleSizeVariation: 24
+
+ SpriteGoal{
+ id: destructor
+ system: container.system
+ active: container.hp <=0
+ anchors.fill: parent
+ particles: ["cruiserArmor"]
+ goalState: "death"
+// jump: true
+ onceOff: true
+ }
+ }
+
+ Timer{
+ id: fireControl
+ property int next: Math.floor(Math.random() * 3) + 1
+ interval: 800
+ running: root.readySetGo
+ repeat: true
+ onTriggered:{
+ if(next == 1){
+ gun1.fireAt(container.target);
+ next = Math.floor(Math.random() * 3) + 1;
+ }else if(next == 2){
+ gun2.fireAt(container.target);
+ next = Math.floor(Math.random() * 3) + 1;
+ }else if(next == 3){
+ gun3.fireAt(container.target);
+ next = Math.floor(Math.random() * 3) + 1;
+ }
+ }
+ }
+
+ Hardpoint{//TODO: Hardpoint abstraction
+ x: 112 - 12 - 8*2
+ y: 128 - 12 - 12*2
+ id: gun1
+ system: container.system
+ show: hp > 0
+ hardpointType: gunType
+ }
+ Hardpoint{
+ x: 64 - 12
+ y: 0 - 12 + 12*2
+ id: gun2
+ system: container.system
+ show: hp > 0
+ hardpointType: gunType
+ }
+ Hardpoint{
+ x: 16 - 12 + 8*2
+ y: 128 - 12 - 12*2
+ id: gun3
+ system: container.system
+ show: hp > 0
+ hardpointType: gunType
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/Frigate.qml b/demos/declarative/plasmapatrol/content/Frigate.qml
new file mode 100644
index 0000000000..54f629268f
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/Frigate.qml
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ property int maxHP: 100
+ property int hp: maxHP
+ property real initialDodge: 0.2
+ property real dodge: initialDodge
+ onHpChanged: if(hp <= 0) target = container;
+ property ParticleSystem system//TODO: Ship abstraction
+ property Item target: container
+ property string shipParticle: "default"//Per team colors?
+ property int gunType: 0
+ width: 128
+ height: 128
+ TrailEmitter{
+ system: container.system
+ particle: "frigateShield"
+ anchors.centerIn: parent
+ particleSize: 92
+ particlesPerSecond: 1
+ particleDuration: 4800
+ emitting: hp > 0
+ }
+ TrailEmitter{
+ system: container.system
+ particle: container.shipParticle
+ anchors.centerIn: parent
+ width: 64
+ height: 16
+ shape: Ellipse{}
+
+ particleSize: 16
+ particleSizeVariation: 8
+ particleEndSize: 8
+ particlesPerSecond: hp > 0 ? hp * 1 + 20 : 0
+ particleDuration: 1200
+ maxParticles: (maxHP * 1 + 20)*2
+ }
+ Timer{
+ id: fireControl
+ property int next: Math.floor(Math.random() * 2) + 1
+ interval: 800
+ running: root.readySetGo
+ repeat: true
+ onTriggered:{
+ if(next == 1){
+ gun1.fireAt(container.target);
+ next = Math.floor(Math.random() * 2) + 1;
+ }else if(next == 2){
+ gun2.fireAt(container.target);
+ next = Math.floor(Math.random() * 2) + 1;
+ }
+ }
+ }
+
+ Hardpoint{
+ x: 128 - 32 - 12
+ y: 64 - 12
+ id: gun1
+ system: container.system
+ show: hp > 0
+ hardpointType: gunType
+ }
+ Hardpoint{
+ x: 0 + 32 - 12
+ y: 64 - 12
+ id: gun2
+ system: container.system
+ show: hp > 0
+ hardpointType: gunType
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/Hardpoint.qml b/demos/declarative/plasmapatrol/content/Hardpoint.qml
new file mode 100644
index 0000000000..184c750a79
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/Hardpoint.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ //ReflectiveProperties
+ //TransferredProperties
+ property variant target: {"y": -90, "x":12}
+ property ParticleSystem system
+ property bool show: true
+ property int hardpointType: 0 //default is pea shooter - always bad.
+
+ property Item targetObj: null
+ property int damageDealt: 0
+ onDamageDealtChanged: dealDamageTimer.start();
+ Timer{
+ id: dealDamageTimer
+ interval: 16
+ running: false
+ repeat: false
+ onTriggered: {targetObj.hp -= damageDealt; damageDealt = 0;}
+ }
+ width: 24
+ height: 24
+ function fireAt(targetArg){//Each implement own
+ if(targetArg != null){
+ hardpointLoader.item.fireAt(targetArg, container);
+ targetObj = targetArg;
+ }
+ }
+ Loader{
+ id: hardpointLoader
+ sourceComponent: {switch(hardpointType){
+ case 1: laserComponent; break;
+ case 2: blasterComponent; break;
+ case 3: cannonComponent; break;
+ default: emptyComponent;
+ }}
+ }
+ Component{
+ id: laserComponent
+ LaserHardpoint{
+ target: container.target
+ system: container.system
+ show: container.show
+ }
+ }
+ Component{
+ id: blasterComponent
+ BlasterHardpoint{
+ target: container.target
+ system: container.system
+ show: container.show
+ }
+ }
+ Component{
+ id: cannonComponent
+ CannonHardpoint{
+ target: container.target
+ system: container.system
+ show: container.show
+ }
+ }
+ Component{
+ id: emptyComponent
+ Item {
+ function fireAt(obj){
+ console.log("Firing null weapon. It hurts.");
+ }
+ }
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/HelpScreens.qml b/demos/declarative/plasmapatrol/content/HelpScreens.qml
new file mode 100644
index 0000000000..8896aeee4a
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/HelpScreens.qml
@@ -0,0 +1,268 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+SequentialLoader {
+ id: hLdr
+ signal exitDesired
+ Component.onCompleted: advance();
+ ParticleSystem{ id: helpSystem }
+ PlasmaPatrolParticles{ sys: helpSystem }
+ pages: [
+ Component{Item{
+ id: story
+ Text{
+ color: "white"
+ text: "Story"
+ font.pixelSize: 48
+ }
+ /*
+ Flickable{
+ y: 60
+ width: 360
+ height: 500
+ contentHeight: txt1.height
+ contentWidth: 360//TODO: Less magic numbers?
+ */
+ Text{
+ id: txt1
+ color: "white"
+ y: 60
+ font.pixelSize: 18
+ text: "
+In a remote nebula, a race of energy beings formed and lived prosperous lives for millenia. Until the schism - when they became constantly at each other's energy-throats. War soon followed, crippling both sides, until a truce was formed. But while governments knew the desparate need for peace, the soldiers in the ion-field were still filled with rampant bloodlust. On the border, patrols are constantly engaging in minor skirmishes whenever they cross paths.
+
+You must select one such patrol unit for the border, heading into an inevitable skirmish, in Plasma Patrol: the game of energy being spaceship combat!
+ "
+ width: 360
+ wrapMode: Text.WordWrap
+ }
+ // }
+ Button{
+ x: 20
+ y: 560
+ height: 40
+ width: 120
+ text: "Next"
+ onClicked: hLdr.advance();
+ }
+ Button{
+ x: 220
+ y: 560
+ height: 40
+ width: 120
+ text: "Menu"
+ onClicked: hLdr.exitDesired();
+ }
+ }},
+ Component{Item{
+ id: ships
+ Text{
+ color: "white"
+ text: "Vessels"
+ font.pixelSize: 48
+ }
+ Column{
+ spacing: 16
+ y: 60
+ Row{
+ height: 128
+ Sloop{
+ system: helpSystem
+ }
+ Text{
+ text: "The nimble sloop"
+ color: "white"
+ font.pixelSize: 18
+ }
+ }
+ Row{
+ height: 128
+ Frigate{
+ system: helpSystem
+ }
+ Text{
+ text: "The versitile shield frigate"
+ color: "white"
+ font.pixelSize: 18
+ }
+ }
+ Row{
+ height: 128
+ Cruiser{
+ system: helpSystem
+ }
+ Text{
+ text: "The armored cruiser"
+ color: "white"
+ font.pixelSize: 18
+ }
+ }
+ }
+ Button{
+ x: 20
+ y: 560
+ height: 40
+ width: 120
+ text: "Next"
+ onClicked: hLdr.advance();
+ }
+ Button{
+ x: 220
+ y: 560
+ height: 40
+ width: 120
+ text: "Menu"
+ onClicked: hLdr.exitDesired();
+ }
+ }},
+ Component{Item{
+ id: guns
+ Text{
+ color: "white"
+ text: "Hardpoints"
+ font.pixelSize: 48
+ }
+ Column{
+ spacing: 16
+ y: 60
+ Row{
+ height: 128
+ LaserHardpoint{
+ system: helpSystem
+ }
+ Text{
+ text: "The laser hardpoint almost always hits the target, even the nimble sloop, but loses much of its potency against the frigate's shields"
+ width: 332
+ wrapMode: Text.WordWrap
+ color: "white"
+ font.pixelSize: 18
+ }
+ }
+ Row{
+ height: 128
+ BlasterHardpoint{
+ system: helpSystem
+ }
+ Text{
+ text: "The blaster passes right through the frigate's shields but loses much of its impact against the armor of the cruiser"
+ width: 332
+ wrapMode: Text.WordWrap
+ color: "white"
+ font.pixelSize: 18
+ }
+ }
+ Row{
+ height: 128
+ CannonHardpoint{
+ system: helpSystem
+ }
+ Text{
+ text: "The cannon has poor accuracy, often missing the nimble sloop, but can punch right through the armor of the cruiser"
+ width: 332
+ wrapMode: Text.WordWrap
+ color: "white"
+ font.pixelSize: 18
+ }
+ }
+ }
+ Button{
+ x: 20
+ y: 560
+ height: 40
+ width: 120
+ text: "Next"
+ onClicked: hLdr.advance();
+ }
+ Button{
+ x: 220
+ y: 560
+ height: 40
+ width: 120
+ text: "Menu"
+ onClicked: hLdr.exitDesired();
+ }
+ }},
+ Component{Item{
+ id: strategy
+ Text{
+ color: "white"
+ text: "Strategy"
+ font.pixelSize: 48
+ }
+ Flickable{
+ y: 60
+ width: 360
+ height: 500
+ contentHeight: txt1.height
+ contentWidth: 360//TODO: Less magic numbers?
+ Text{
+ id: txt1
+ color: "white"
+ font.pixelSize: 18
+ text: "
+Basic Strategy: Good luck, have fun - don't die.
+More to come after thorough playtesting.
+ "
+ width: 360
+ wrapMode: Text.WordWrap
+ }
+ }
+ Button{
+ x: 20
+ y: 560
+ height: 40
+ width: 120
+ text: "Story"
+ onClicked: {hLdr.at=0; hLdr.advance();}
+ }
+ Button{
+ x: 220
+ y: 560
+ height: 40
+ width: 120
+ text: "Menu"
+ onClicked: hLdr.exitDesired();
+ }
+ }}
+ ]
+}
diff --git a/demos/declarative/plasmapatrol/content/LaserHardpoint.qml b/demos/declarative/plasmapatrol/content/LaserHardpoint.qml
new file mode 100644
index 0000000000..d6d470a15b
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/LaserHardpoint.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ property variant target: {"y": -90, "x":12}
+ property ParticleSystem system
+ property bool show: true
+
+ width: 24
+ height: 24
+ TrailEmitter{
+ id: visualization
+ particle: "laser"
+ system: container.system
+ anchors.fill: parent
+ emitting: container.show
+ shape: Ellipse{}
+ speed: DirectedVector{ targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
+ particleDuration: 1000
+ particlesPerSecond: 64
+
+ particleSize: 24
+ particleSizeVariation: 8
+ particleEndSize: 8
+ }
+
+ function fireAt(targetArg, hardpoint){
+ if(targetArg.hp <= 0)
+ return;
+ //TODO: calculate hit and damage at target, which must be a Ship
+ var offset = 0;
+ if(Math.random() < 0.99){
+ switch(targetArg.shipType){
+ case 1: hardpoint.damageDealt += 16; break;
+ case 2: hardpoint.damageDealt += 4; break;
+ case 3: hardpoint.damageDealt += 8; break;
+ default: hardpoint.damageDealt += 500; //Really effective against unregistered vessels
+ }
+ }else{//Misses with Lasers are really rare
+ offset = Math.random() * 100;
+ }
+ target = container.mapFromItem(targetArg, offset + targetArg.width/2, offset + targetArg.height/2);
+ emitter.pulse(0.10);
+ // console.log("Fire box: " + Math.min(container.width/2, target.x) + "," + Math.min(container.height/2, target.y) + " " + (Math.max(container.width/2, target.x) - Math.min(container.width/2, target.x)) + "," + (Math.max(container.height/2, target.y) - Math.min(container.height/2, target.y)));
+ }
+ TrailEmitter{
+ id: emitter
+ particle: "laser"
+ emitting: false
+ system: container.system
+ x: Math.min(container.width/2, target.x);
+ width: Math.max(container.width/2, target.x) - x;
+ y: Math.min(container.height/2, target.y);
+ height: Math.max(container.height/2, target.y) - y;
+ shape: Line{
+ mirrored: (emitter.y < 0 || emitter.x < 0) && !(emitter.y < 0 && emitter.x < 0 )//I just want XOR
+ }
+
+ particleDuration: 1000
+ particlesPerSecond: 8000
+ maxParticles: 800
+ particleSize: 16
+ particleEndSize: 0
+
+ speed: PointVector{xVariation: 4; yVariation: 4}
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml b/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml
new file mode 100644
index 0000000000..7a6fcb96d0
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/PlasmaPatrolParticles.qml
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item{
+ property ParticleSystem sys
+ ColoredParticle{
+ system: sys
+ particles: ["default"]
+ image: "pics/blur-circle3.png"
+ color: "#003A3A3A"
+ colorVariation: 0.1
+ z: 0
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["redTeam"]
+ image: "pics/blur-circle3.png"
+ color: "#0028060A"
+ colorVariation: 0.1
+ z: 0
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["greenTeam"]
+ image: "pics/blur-circle3.png"
+ color: "#0006280A"
+ colorVariation: 0.1
+ z: 0
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["blaster"]
+ image: "pics/star2.png"
+ //color: "#0F282406"
+ color: "#0F484416"
+ colorVariation: 0.2
+ z: 2
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["laser"]
+ image: "pics/star3.png"
+ //color: "#00123F68"
+ color: "#00428FF8"
+ colorVariation: 0.2
+ z: 2
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["cannon"]
+ image: "pics/particle.png"
+ color: "#80FFAAFF"
+ colorVariation: 0.1
+ z: 2
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["cannonCore"]
+ image: "pics/particle.png"
+ color: "#00666666"
+ colorVariation: 0.8
+ z: 1
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["cannonWake"]
+ image: "pics/star.png"
+ color: "#00CCCCCC"
+ colorVariation: 0.2
+ z: 1
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["frigateShield"]
+ image: "pics/blur-circle2.png"
+ color: "#00000000"
+ colorVariation: 0.05
+ blueVariation: 0.5
+ greenVariation: 0.1
+ z: 3
+ }
+ SpriteParticle{
+ system: sys
+ particles: ["cruiserArmor"]
+ z: 1
+ sprites:[Sprite{
+ id: spinState
+ name: "spinning"
+ source: "pics/meteor.png"
+ frames: 35
+ duration: 40
+ to: {"death":0, "spinning":1}
+ },Sprite{
+ name: "death"
+ source: "pics/meteor_explo.png"
+ frames: 22
+ duration: 40
+ to: {"null":1}
+ }, Sprite{
+ name: "null"
+ source: "pics/nullRock.png"
+ frames: 1
+ duration: 1000
+ }
+ ]
+ }
+ FollowEmitter{
+ system: sys
+ particle: "cannonWake"
+ follow: "cannon"
+ particlesPerParticlePerSecond: 64
+ particleDuration: 600
+ speed: AngleVector{ angleVariation: 360; magnitude: 48}
+ particleSize: 16
+ particleEndSize: 8
+ particleSizeVariation: 2
+ emitting: true
+ width: 1000//XXX: Terrible hack
+ height: 1000
+ }
+ FollowEmitter{
+ system: sys
+ particle: "cannonCore"
+ follow: "cannon"
+ particlesPerParticlePerSecond: 256
+ particleDuration: 128
+ particleSize: 24
+ particleEndSize: 8
+ emitting: true
+ width: 1000//XXX: Terrible hack
+ height: 1000
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/SequentialLoader.qml b/demos/declarative/plasmapatrol/content/SequentialLoader.qml
new file mode 100644
index 0000000000..85a979b222
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/SequentialLoader.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+Item{
+ id: container
+ //TODO: Somehow get particles into this?
+ property list<Component> pages
+ property Item cur: null
+ property int at: 0
+ function advance(){
+ if(cur != null)
+ cur.destroy();
+ cur = pages[at++].createObject(container);
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/Ship.qml b/demos/declarative/plasmapatrol/content/Ship.qml
new file mode 100644
index 0000000000..0ccea94221
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/Ship.qml
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: me
+ //Reflective Properties
+ width: shipLoader.width
+ height: shipLoader.height
+ //Transfered Properties
+ property int hp: 100//shipLoader.item.maxHP
+ property real dodge: shipLoader.item.initialDodge
+ property ParticleSystem system
+ property int targetIdx: 0
+ property Item target: targets[targetIdx] == undefined?null:targets[targetIdx]
+ Connections{
+ target: me.target
+ onHpChanged: if(me.target.hp<=0) me.targetIdx++;
+ }
+ property list<Item> targets
+ property string shipParticle: "default"//Per team colors?
+ property int gunType: 0
+ property int shipType: 0
+ Component{
+ id: sloopComp
+ Sloop{
+ system: me.system
+ target: me.target
+ shipParticle: me.shipParticle
+ gunType: me.gunType
+ hp: me.hp
+ dodge: me.dodge
+ }
+ }
+ Component{
+ id: frigateComp
+ Frigate{
+ system: me.system
+ target: me.target
+ shipParticle: me.shipParticle
+ gunType: me.gunType
+ hp: me.hp
+ dodge: me.dodge
+ }
+ }
+ Component{
+ id: cruiserComp
+ Cruiser{
+ system: me.system
+ target: me.target
+ shipParticle: me.shipParticle
+ gunType: me.gunType
+ hp: me.hp
+ dodge: me.dodge
+ }
+ }
+ Component{
+ id: dumbComp
+ Item{
+ property int maxHP: 0
+ property int initialDodge: 0
+ }
+ }
+ Loader{
+ id: shipLoader
+ sourceComponent:{ switch(shipType){
+ case 1: sloopComp; break;
+ case 2: frigateComp; break;
+ case 3: cruiserComp; break;
+ default: dumbComp;
+ }
+ }
+ }
+}
diff --git a/demos/declarative/plasmapatrol/content/Sloop.qml b/demos/declarative/plasmapatrol/content/Sloop.qml
new file mode 100644
index 0000000000..1b9bce7333
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/Sloop.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Item {
+ id: container
+ property int maxHP: 100
+ property int hp: maxHP
+ property real initialDodge: 0.5
+ property real dodge: initialDodge
+ property int blinkInterval: 800
+ onHpChanged: if(hp <= 0) target = container;
+ property ParticleSystem system//TODO: Ship abstraction
+ property Item target: container
+ property string shipParticle: "default"//Per team colors?
+ property int gunType: 0
+ width: 128
+ height: 128
+ TrailEmitter{
+ id: emitter
+ //TODO: Cooler would be an 'orbiting' affector
+ //TODO: On the subject, opacity and size should be grouped type 'overLife' if we can cram that in the particles
+ system: container.system
+ particle: container.shipParticle
+ shape: Ellipse{}
+
+ particlesPerSecond: hp > 0 ? hp + 20 : 0
+ particleDuration: blinkInterval
+ maxParticles: (maxHP + 20)
+
+ acceleration: AngleVector{angleVariation: 360; magnitude: 8}
+
+ particleSize: 24
+ particleEndSize: 4
+ particleSizeVariation: 8
+ width: 16
+ height: 16
+ x: 64
+ y: 64
+ Behavior on x{NumberAnimation{duration:blinkInterval}}
+ Behavior on y{NumberAnimation{duration:blinkInterval}}
+ Timer{
+ interval: blinkInterval
+ running: true
+ repeat: true
+ onTriggered: {
+ emitter.x = Math.random() * 48 + 32
+ emitter.y = Math.random() * 48 + 32
+ }
+ }
+ }
+ Hardpoint{
+ anchors.centerIn: parent
+ id: gun2
+ system: container.system
+ show: container.hp > 0
+ hardpointType: gunType
+ }
+ Timer{
+ id: fireControl
+ interval: 800
+ running: root.readySetGo
+ repeat: true
+ onTriggered:{
+ gun2.fireAt(container.target);
+ }
+ }
+
+}
diff --git a/demos/declarative/plasmapatrol/content/pics/TitleText.png b/demos/declarative/plasmapatrol/content/pics/TitleText.png
new file mode 100644
index 0000000000..dc3acebe39
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/TitleText.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/blur-circle2.png b/demos/declarative/plasmapatrol/content/pics/blur-circle2.png
new file mode 100644
index 0000000000..f7c9f3e98e
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/blur-circle2.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/blur-circle3.png b/demos/declarative/plasmapatrol/content/pics/blur-circle3.png
new file mode 100644
index 0000000000..dbc39cb16e
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/blur-circle3.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/finalfrontier.png b/demos/declarative/plasmapatrol/content/pics/finalfrontier.png
new file mode 100644
index 0000000000..2ba1815230
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/finalfrontier.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/meteor.png b/demos/declarative/plasmapatrol/content/pics/meteor.png
new file mode 100644
index 0000000000..e8c368aea7
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/meteor.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/meteor_explo.png b/demos/declarative/plasmapatrol/content/pics/meteor_explo.png
new file mode 100644
index 0000000000..4297245d49
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/meteor_explo.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/nullRock.png b/demos/declarative/plasmapatrol/content/pics/nullRock.png
new file mode 100644
index 0000000000..4076327a1a
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/nullRock.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/particle.png b/demos/declarative/plasmapatrol/content/pics/particle.png
new file mode 100644
index 0000000000..5c83896d22
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/particle.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/star.png b/demos/declarative/plasmapatrol/content/pics/star.png
new file mode 100644
index 0000000000..0d592cfa87
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/star.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/star2.png b/demos/declarative/plasmapatrol/content/pics/star2.png
new file mode 100644
index 0000000000..bb55c44788
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/star2.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/content/pics/star3.png b/demos/declarative/plasmapatrol/content/pics/star3.png
new file mode 100644
index 0000000000..636a25f480
--- /dev/null
+++ b/demos/declarative/plasmapatrol/content/pics/star3.png
Binary files differ
diff --git a/demos/declarative/plasmapatrol/plasmapatrol.qml b/demos/declarative/plasmapatrol/plasmapatrol.qml
new file mode 100644
index 0000000000..3a7b217618
--- /dev/null
+++ b/demos/declarative/plasmapatrol/plasmapatrol.qml
@@ -0,0 +1,386 @@
+/****************************************************************************
+**
+** 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 QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "content"
+
+Rectangle {
+ id: root
+ property bool readySetGo: false
+ //Debugging
+ property int hits: 0
+ property int misses: 0
+ property real ratio: hits/(misses?misses:1)
+ //Move to JS file?
+ property Ship redVar1: Ship{shipType: 1; gunType: 1}
+ property Ship redVar2: Ship{shipType: 1; gunType: 2}
+ property Ship redVar3: Ship{shipType: 1; gunType: 3}
+ property Ship greenVar1: Ship{shipType: 3; gunType: 1}
+ property Ship greenVar2: Ship{shipType: 2; gunType: 2}
+ property Ship greenVar3: Ship{shipType: 1; gunType: 3}
+ property string winner: "0"
+ property int players: 0
+ function aiSet(ship){
+ ship.gunType = Math.floor(Math.random() * 3) + 1
+ ship.shipType = Math.floor(Math.random() * 3) + 1
+ }
+
+ width: 360
+ height: 600
+ color: "black"
+ SequentialLoader{
+ anchors.fill: parent
+ //General Children
+ Image{
+ anchors.centerIn: parent
+ source: "content/pics/finalfrontier.png"
+ }
+ ParticleSystem{
+ id: particles
+ }
+ PlasmaPatrolParticles{ sys: particles; z: 100 }//Renders all particles on the one plane
+ //Component parts
+ id: pageControl
+ Component.onCompleted: advance();
+ pages:[
+ Component{Item{
+ id: menu
+ width: root.width
+ height: root.height
+ Column{
+ anchors.verticalCenter: parent.verticalCenter
+ width: parent.width
+ spacing: 8
+ Item{
+ id: title
+ width: root.width
+ height: 240
+ TrailEmitter{
+ anchors.fill: parent
+ system: particles
+ emitting: true
+ particle: "default"
+ particlesPerSecond: 1200
+ particleDuration: 1200
+ shape: Mask{source:"content/pics/TitleText.png"}
+ particleSize: 16
+ particleEndSize: 0
+ particleSizeVariation: 8
+ speed: AngleVector{angleVariation:360; magnitudeVariation: 6}
+ }
+ }
+ Button{
+ text: "1P"
+ onClicked: {root.players = 1; pageControl.advance();}
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Button{
+ text: "2P"
+ onClicked: {root.players = 2; pageControl.advance();}
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Button{
+ text: "Demo"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {root.players = 0;
+ aiSet(redVar1);
+ aiSet(redVar2);
+ aiSet(redVar3);
+ aiSet(greenVar1);
+ aiSet(greenVar2);
+ aiSet(greenVar3);
+ pageControl.at = 5;//TODO: Not a magic number
+ pageControl.advance();}
+ }
+ Button{
+ text: "Help"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ pageControl.at = 7;//TODO: Not a magic number
+ pageControl.advance();
+ }
+ }
+ Button{
+ text: "Quit"
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: Qt.quit();
+ }
+ }
+ }},
+ Component{Item{
+ id: p1Screen
+ z: 101
+ width: root.width
+ height: root.height
+ Rectangle{
+ anchors.fill: parent
+ color: "red"
+ }
+ Text{
+ anchors.centerIn: parent
+ color: "white"
+ font.pixelSize: 64
+ font.bold: true
+ text: "Player\n 1"
+ horizontalAlignment: Text.AlignHCenter
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: pageControl.advance()
+ }
+ }},
+ Component{Item{
+ id: p1Choices
+ z: 3
+ width: root.width
+ height: root.height
+ Rectangle{
+ color: "black"
+ anchors.fill: parent
+ }
+ Column{
+ spacing: 16
+ width: root.width
+ anchors.horizontalCenter: parent.horizontalCenter
+ ChoiceBox{
+ target: redVar1
+ system: particles
+ }
+ ChoiceBox{
+ target: redVar2
+ system: particles
+ }
+ ChoiceBox{
+ target: redVar3
+ system: particles
+ }
+ Button{
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Next"
+ onClicked: {
+ if(root.players < 2){
+ aiSet(greenVar1);
+ aiSet(greenVar2);
+ aiSet(greenVar3);
+ pageControl.at = 5;//TODO: Not a magic number
+ }
+ pageControl.advance();
+ }
+ }
+ }
+ }},
+ Component{Item{
+ id: p2Screen
+ z: 101
+ width: root.width
+ height: root.height
+ Rectangle{
+ anchors.fill: parent
+ color: "green"
+ }
+ Text{
+ anchors.centerIn: parent
+ color: "white"
+ font.pixelSize: 64
+ font.bold: true
+ text: "Player\n 2"
+ horizontalAlignment: Text.AlignHCenter
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: pageControl.advance()
+ }
+ }},
+ Component{Item{
+ id: p2Choices
+ z: 1
+ width: root.width
+ height: root.height
+ Rectangle{
+ color: "black"
+ anchors.fill: parent
+ }
+ Column{
+ spacing: 16
+ width: root.width
+ anchors.horizontalCenter: parent.horizontalCenter
+ ChoiceBox{
+ target: greenVar1
+ system: particles
+ }
+ ChoiceBox{
+ target: greenVar2
+ system: particles
+ }
+ ChoiceBox{
+ target: greenVar3
+ system: particles
+ }
+ Button{
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "Next"
+ onClicked: pageControl.advance()
+ }
+ }
+ }},
+ Component{Item{
+ id: arena
+ width: root.width
+ height: root.height
+ z: 0
+ Component.onCompleted: root.readySetGo = true
+ Component.onDestruction: root.readySetGo = false
+ property bool victory: redShip3.hp <= 0 || greenShip3.hp <=0
+ onVictoryChanged: {
+ if(redShip3.hp <= 0){
+ if(greenShip3.hp <= 0){
+ root.winner = "1&2"
+ }else{
+ root.winner = "2"
+ }
+ }else{
+ root.winner = "1"
+ }
+ winTimer.start()
+ }
+ Timer{
+ id: winTimer
+ interval: 1200
+ repeat: false
+ running: false
+ onTriggered: pageControl.advance();
+ }
+ Ship{
+ id: redShip1
+ shipParticle: "redTeam"
+ system: particles
+ x: 180-64
+ y: 128
+ shipType: redVar1.shipType
+ gunType: redVar1.gunType
+ targets: [greenShip1, greenShip2, greenShip3]
+ }
+ Ship{
+ id: redShip2
+ shipParticle: "redTeam"
+ system: particles
+ x: 0
+ y: 0
+ shipType: redVar2.shipType
+ gunType: redVar2.gunType
+ targets: [greenShip1, greenShip2, greenShip3]
+ }
+ Ship{
+ id: redShip3
+ shipParticle: "redTeam"
+ system: particles
+ x: 360-128
+ y: 0
+ shipType: redVar3.shipType
+ gunType: redVar3.gunType
+ targets: [greenShip1, greenShip2, greenShip3]
+ }
+
+ Ship{
+ id: greenShip1
+ shipParticle: "greenTeam"
+ system: particles
+ x: 180-64
+ y: 600 - 128 - 128
+ shipType: greenVar1.shipType
+ gunType: greenVar1.gunType
+ targets: [redShip1, redShip2, redShip3]
+ }
+ Ship{
+ id: greenShip2
+ shipParticle: "greenTeam"
+ system: particles
+ x: 0
+ y: 600-128
+ shipType: greenVar2.shipType
+ gunType: greenVar2.gunType
+ targets: [redShip1, redShip2, redShip3]
+ }
+ Ship{
+ id: greenShip3
+ shipParticle: "greenTeam"
+ system: particles
+ x: 360 - 128
+ y: 600 - 128
+ shipType: greenVar3.shipType
+ gunType: greenVar3.gunType
+ targets: [redShip1, redShip2, redShip3]
+ }
+ }},
+ Component{Item{
+ id: winScreen
+ z: 101
+ width: root.width
+ height: root.height
+ /*
+ Rectangle{
+ anchors.fill: parent
+ color: "black"
+ }
+ */
+ Text{//TODO: Particle Text?
+ anchors.fill: parent
+ color: "white"
+ font.pixelSize: 64
+ font.bold: true
+ text: "Player " + root.winner + " wins!"
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: {pageControl.at = 0; pageControl.advance();}
+ }
+ }},
+ Component{
+ HelpScreens{
+ onExitDesired: {pageControl.at = 0; pageControl.advance();}
+ }
+ }
+ ]
+ }
+}
diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
index 009aeca2c6..3d11fb9df2 100644
--- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml
+++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
@@ -39,8 +39,8 @@
**
****************************************************************************/
-import QtQuick 1.1
-import Qt.labs.particles 1.0
+import QtQuick 2.0
+import Qt.labs.particles 2.0
Item {
id: block
@@ -71,26 +71,28 @@ Item {
Behavior on opacity { NumberAnimation { duration: 200 } }
anchors.fill: parent
}
-
- Particles {
+ TrailEmitter {
id: particles
-
- width: 1; height: 1
- anchors.centerIn: parent
-
- emissionRate: 0
- lifeSpan: 700; lifeSpanDeviation: 600
- angle: 0; angleDeviation: 360;
- velocity: 100; velocityDeviation: 30
- source: {
+ system: particleSystem
+ particle: {
if(type == 0){
- "pics/redStar.png";
+ "red";
} else if (type == 1) {
- "pics/blueStar.png";
+ "blue";
} else {
- "pics/greenStar.png";
+ "green";
}
}
+ anchors.fill: parent
+
+ speed: DirectedVector{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ shape: Ellipse{fill:true}
+ emitting: false;
+ particleDuration: 700; particleDurationVariation: 100
+ particlesPerSecond: 1000
+ maxParticles: 100 //only fires 0.1s bursts (still 2x old number, ColoredParticle wants less than 16000 max though)
+ particleSize: 28
+ particleEndSize: 14
}
states: [
@@ -101,7 +103,7 @@ Item {
State {
name: "DeathState"; when: dying == true
- StateChangeScript { script: particles.burst(50); }
+ StateChangeScript { script: particles.pulse(0.1); }
PropertyChanges { target: img; opacity: 0 }
StateChangeScript { script: block.destroy(1000); }
}
diff --git a/demos/declarative/samegame/SamegameCore/Button.qml b/demos/declarative/samegame/SamegameCore/Button.qml
index b2b232ca8e..8bcca5b5d5 100644
--- a/demos/declarative/samegame/SamegameCore/Button.qml
+++ b/demos/declarative/samegame/SamegameCore/Button.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtQuick 1.1
+import QtQuick 2.0
Rectangle {
id: container
diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml
index ecac475826..ee1b51006a 100644
--- a/demos/declarative/samegame/SamegameCore/Dialog.qml
+++ b/demos/declarative/samegame/SamegameCore/Dialog.qml
@@ -39,23 +39,26 @@
**
****************************************************************************/
-import QtQuick 1.1
+import QtQuick 2.0
Rectangle {
id: page
property Item text: dialogText
+ property bool open: false
signal closed
signal opened
function forceClose() {
- if(page.opacity == 0)
+ if(!open)
return; //already closed
+ page.open = false;
page.closed();
page.opacity = 0;
}
function show(txt) {
+ page.open = true;
page.opened();
dialogText.text = txt;
page.opacity = 1;
diff --git a/demos/declarative/samegame/SamegameCore/pics/blueStar.png b/demos/declarative/samegame/SamegameCore/pics/blueStar.png
deleted file mode 100644
index ff9588f80a..0000000000
--- a/demos/declarative/samegame/SamegameCore/pics/blueStar.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/samegame/SamegameCore/pics/greenStar.png b/demos/declarative/samegame/SamegameCore/pics/greenStar.png
deleted file mode 100644
index cd06854719..0000000000
--- a/demos/declarative/samegame/SamegameCore/pics/greenStar.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/samegame/SamegameCore/pics/particle.png b/demos/declarative/samegame/SamegameCore/pics/particle.png
new file mode 100644
index 0000000000..5c83896d22
--- /dev/null
+++ b/demos/declarative/samegame/SamegameCore/pics/particle.png
Binary files differ
diff --git a/demos/declarative/samegame/SamegameCore/pics/redStar.png b/demos/declarative/samegame/SamegameCore/pics/redStar.png
deleted file mode 100644
index 0a4dffe583..0000000000
--- a/demos/declarative/samegame/SamegameCore/pics/redStar.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/samegame/SamegameCore/pics/star.png b/demos/declarative/samegame/SamegameCore/pics/star.png
deleted file mode 100644
index defbde53ca..0000000000
--- a/demos/declarative/samegame/SamegameCore/pics/star.png
+++ /dev/null
Binary files differ
diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index bb587bc6f3..4c5cbe5bb3 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -4,10 +4,11 @@ var maxColumn = 10;
var maxRow = 15;
var maxIndex = maxColumn*maxRow;
var board = new Array(maxIndex);
-var blockSrc = "SamegameCore/BoomBlock.qml";
+var blockSrc = "BoomBlock.qml";
var scoresURL = "";
var gameDuration;
var component = Qt.createComponent(blockSrc);
+var highScoreBar = 0;
// Index function used instead of a 2D array
function index(column, row)
@@ -152,11 +153,15 @@ function victoryCheck()
// Checks for game over
if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) {
gameDuration = new Date() - gameDuration;
- nameInputDialog.show("You won! Please enter your name: ");
- nameInputDialog.initialWidth = nameInputDialog.text.width + 20;
- if (nameInputDialog.name == "")
- nameInputDialog.width = nameInputDialog.initialWidth;
- nameInputDialog.text.opacity = 0; // Just a spacer
+ if(gameCanvas.score > highScoreBar){
+ nameInputDialog.show("You won! Please enter your name: ");
+ nameInputDialog.initialWidth = nameInputDialog.text.width + 20;
+ if (nameInputDialog.name == "")
+ nameInputDialog.width = nameInputDialog.initialWidth;
+ nameInputDialog.text.opacity = 0; // Just a spacer
+ }else{
+ dialog.show("You won!");
+ }
}
}
@@ -203,6 +208,30 @@ function createBlock(column,row)
return true;
}
+function initHighScoreBar()
+{
+ if(scoresURL != "")
+ return true;//don't query remote scores
+ var db = openDatabaseSync(
+ "SameGameScores",
+ "1.0",
+ "Local SameGame High Scores",
+ 100
+ );
+ db.transaction(
+ function(tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)');
+ // Only show results for the current grid size
+ var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'
+ + maxColumn + "x" + maxRow + '" ORDER BY score desc LIMIT 10');
+ if(rs.rows.length < 10)
+ highScoreBar = 0;
+ else
+ highScoreBar = rs.rows.item(rs.rows.length - 1).score;
+ }
+ );
+}
+
function saveHighScore(name)
{
if (scoresURL != "")
@@ -235,6 +264,8 @@ function saveHighScore(name)
+ rs.rows.item(i).score + ' points in '
+ rs.rows.item(i).time + ' seconds.\n';
}
+ if(rs.rows.length == 10)
+ highScoreBar = rs.rows.item(9).score;
dialog.show(r);
}
);
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml
index ab64156278..0defdeec3c 100644
--- a/demos/declarative/samegame/samegame.qml
+++ b/demos/declarative/samegame/samegame.qml
@@ -39,13 +39,14 @@
**
****************************************************************************/
-import QtQuick 1.1
+import QtQuick 2.0
+import Qt.labs.particles 2.0
import "SamegameCore"
import "SamegameCore/samegame.js" as Logic
Rectangle {
id: screen
- width: 490; height: 720
+ width: 360; height: 640
property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos
SystemPalette { id: activePalette }
@@ -74,6 +75,36 @@ Rectangle {
anchors.fill: parent; onClicked: Logic.handleClick(mouse.x,mouse.y);
}
}
+ Item{
+ ParticleSystem{ id: particleSystem; }
+ ColoredParticle {
+ system: particleSystem
+ particles: ["red"]
+ color: Qt.darker("red");//Actually want desaturated...
+ image: "SamegameCore/pics/particle.png"
+ colorVariation: 0.4
+ alpha: 0.1
+ }
+ ColoredParticle {
+ system: particleSystem
+ particles: ["green"]
+ color: Qt.darker("green");//Actually want desaturated...
+ image: "SamegameCore/pics/particle.png"
+ colorVariation: 0.4
+ alpha: 0.1
+ }
+ ColoredParticle {
+ system: particleSystem
+ particles: ["blue"]
+ color: Qt.darker("blue");//Actually want desaturated...
+ image: "SamegameCore/pics/particle.png"
+ colorVariation: 0.4
+ alpha: 0.1
+ }
+ id: aboveGameCanvas
+ anchors.fill: gameCanvas
+ z: gameCanvas.z + 1
+ }
}
Dialog { id: dialog; anchors.centerIn: parent; z: 21 }
diff --git a/demos/declarative/shadereffects/Slider.qml b/demos/declarative/shadereffects/Slider.qml
new file mode 100644
index 0000000000..e31335d984
--- /dev/null
+++ b/demos/declarative/shadereffects/Slider.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** 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 Declarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ property real value: bar.x / (foo.width - bar.width)
+ Item {
+ id: foo
+ width: parent.width - 4
+ height: 6
+ anchors.centerIn: parent
+
+ Rectangle {
+ height: parent.height
+ anchors.left: parent.left
+ anchors.right: bar.horizontalCenter
+ color: "blue"
+ radius: 3
+ }
+ Rectangle {
+ height: parent.height
+ anchors.left: bar.horizontalCenter
+ anchors.right: parent.right
+ color: "gray"
+ radius: 3
+ }
+ Rectangle {
+ anchors.fill: parent
+ color: "transparent"
+ radius: 3
+ border.width: 2
+ border.color: "black"
+ }
+
+ Rectangle {
+ id: bar
+ y: -7
+ width: 20
+ height: 20
+ radius: 15
+ color: "white"
+ border.width: 2
+ border.color: "black"
+ MouseArea {
+ anchors.fill: parent
+ drag.target: parent
+ drag.axis: Drag.XAxis
+ drag.minimumX: 0
+ drag.maximumX: foo.width - parent.width
+ }
+ }
+ }
+}
+
diff --git a/demos/declarative/shadereffects/face-smile.png b/demos/declarative/shadereffects/face-smile.png
new file mode 100644
index 0000000000..3d66d72578
--- /dev/null
+++ b/demos/declarative/shadereffects/face-smile.png
Binary files differ
diff --git a/demos/declarative/shadereffects/qt-logo.png b/demos/declarative/shadereffects/qt-logo.png
new file mode 100644
index 0000000000..7d3e97eb36
--- /dev/null
+++ b/demos/declarative/shadereffects/qt-logo.png
Binary files differ
diff --git a/demos/declarative/shadereffects/shader-demo.qml b/demos/declarative/shadereffects/shader-demo.qml
new file mode 100644
index 0000000000..1226064a5d
--- /dev/null
+++ b/demos/declarative/shadereffects/shader-demo.qml
@@ -0,0 +1,295 @@
+/****************************************************************************
+**
+** 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 Declarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Image {
+ width: 640
+ height: 360
+ source: "../snake/content/pics/background.png"
+
+ ShaderEffectSource {
+ id: theSource
+ sourceItem: theItem
+ smooth: true
+ }
+
+ function saturate(x) {
+ return Math.min(Math.max(x, 0), 1)
+ }
+
+ function sliderToColor(x) {
+ return Qt.rgba(saturate(Math.max(2 - 6 * x, 6 * x - 4)),
+ saturate(Math.min(6 * x, 4 - 6 * x)),
+ saturate(Math.min(6 * x - 2, 6 - 6 * x)))
+ }
+
+ Grid {
+ anchors.centerIn: parent
+ columns: 3
+
+ Item {
+ id: theItem
+ width: 180
+ height: 180
+ ListView {
+ anchors.centerIn: parent
+ width: 160
+ height: 140
+ clip: true
+ snapMode: ListView.SnapOneItem
+ model: VisualItemModel {
+ Text {
+ width: 160
+ height: 140
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: 120
+ font.family: "Times"
+ color: "blue"
+ text: "Qt"
+ }
+ Image {
+ width: 160
+ height: 140
+ source: "qt-logo.png"
+ smooth: true
+ }
+ Image {
+ width: 160
+ height: 140
+ source: "face-smile.png"
+ smooth: true
+ }
+ }
+ }
+ }
+ ShaderEffectItem {
+ width: 180
+ height: 180
+ property variant source: theSource
+ property real amplitude: 0.04 * wobbleSlider.value
+ property real frequency: 20
+ property real time: 0
+ NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 }
+ fragmentShader:
+ "uniform highp float amplitude;" +
+ "uniform highp float frequency;" +
+ "uniform highp float time;" +
+ "uniform sampler2D source;" +
+ "varying highp vec2 qt_TexCoord0;" +
+ "void main() {" +
+ " highp vec2 p = sin(time + frequency * qt_TexCoord0);" +
+ " gl_FragColor = texture2D(source, qt_TexCoord0 + amplitude * vec2(p.y, -p.x));" +
+ "}"
+ Slider {
+ id: wobbleSlider
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 40
+ }
+ }
+ ShaderEffectItem {
+ width: 180
+ height: 180
+ property variant source: theSource
+ property variant shadow: ShaderEffectSource {
+ smooth: true
+ sourceItem: ShaderEffectItem {
+ width: theItem.width
+ height: theItem.height
+ property variant delta: Qt.size(0.0, 1.0 / height)
+ property variant source: ShaderEffectSource {
+ smooth: true
+ sourceItem: ShaderEffectItem {
+ width: theItem.width
+ height: theItem.height
+ property variant delta: Qt.size(1.0 / width, 0.0)
+ property variant source: theSource
+ fragmentShader: "
+ uniform sampler2D source;
+ uniform highp vec2 delta;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = 0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta)
+ + 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta)
+ + 0.2466 * texture2D(source, qt_TexCoord0)
+ + 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta)
+ + 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta);
+ }"
+ }
+ }
+ fragmentShader: "
+ uniform sampler2D source;
+ uniform highp vec2 delta;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ gl_FragColor = 0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta)
+ + 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta)
+ + 0.2466 * texture2D(source, qt_TexCoord0)
+ + 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta)
+ + 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta);
+ }"
+ }
+ }
+ property real angle: 0
+ property variant offset: Qt.point(15.0 * Math.cos(angle), 15.0 * Math.sin(angle))
+ NumberAnimation on angle { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 6000 }
+ property variant delta: Qt.size(offset.x / width, offset.y / height)
+ property real darkness: shadowSlider.value
+ fragmentShader: "
+ uniform highp vec2 offset;
+ uniform sampler2D source;
+ uniform sampler2D shadow;
+ uniform highp float darkness;
+ uniform highp vec2 delta;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ lowp vec4 fg = texture2D(source, qt_TexCoord0);
+ lowp vec4 bg = texture2D(shadow, qt_TexCoord0 + delta);
+ gl_FragColor = fg + vec4(0., 0., 0., darkness * bg.a) * (1. - fg.a);
+ }"
+ Slider {
+ id: shadowSlider
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 40
+ }
+ }
+ ShaderEffectItem {
+ width: 180
+ height: 180
+ property variant source: theSource
+ property variant delta: Qt.size(0.5 / width, 0.5 / height)
+ fragmentShader: "
+ uniform sampler2D source;
+ uniform highp vec2 delta;
+ uniform highp float qt_Opacity;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ lowp vec4 tl = texture2D(source, qt_TexCoord0 - delta);
+ lowp vec4 tr = texture2D(source, qt_TexCoord0 + vec2(delta.x, -delta.y));
+ lowp vec4 bl = texture2D(source, qt_TexCoord0 - vec2(delta.x, -delta.y));
+ lowp vec4 br = texture2D(source, qt_TexCoord0 + delta);
+ lowp vec4 gx = (tl + bl) - (tr + br);
+ lowp vec4 gy = (tl + tr) - (bl + br);
+ gl_FragColor.xyz = vec3(0.);
+ gl_FragColor.w = clamp(dot(sqrt(gx * gx + gy * gy), vec4(1.)), 0., 1.) * qt_Opacity;
+ }"
+ }
+ ShaderEffectItem {
+ width: 180
+ height: 180
+ property variant source: theSource
+ property color tint: sliderToColor(colorizeSlider.value)
+ fragmentShader: "
+ uniform sampler2D source;
+ uniform lowp vec4 tint;
+ uniform lowp float qt_Opacity;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ lowp vec4 c = texture2D(source, qt_TexCoord0);
+ lowp float lo = min(min(c.x, c.y), c.z);
+ lowp float hi = max(max(c.x, c.y), c.z);
+ gl_FragColor = qt_Opacity * vec4(mix(vec3(lo), vec3(hi), tint.xyz), c.w);
+ }"
+ Slider {
+ id: colorizeSlider
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 40
+ }
+ }
+ ShaderEffectItem {
+ width: 180
+ height: 180
+ mesh: GridMesh { resolution: Qt.size(10, 10) }
+ property variant source: theSource
+ property real bend: 0
+ property real minimize: 0
+ property real side: genieSlider.value
+ SequentialAnimation on bend {
+ loops: Animation.Infinite
+ NumberAnimation { to: 1; duration: 700; easing.type: Easing.InOutSine }
+ PauseAnimation { duration: 1600 }
+ NumberAnimation { to: 0; duration: 700; easing.type: Easing.InOutSine }
+ PauseAnimation { duration: 1000 }
+ }
+ SequentialAnimation on minimize {
+ loops: Animation.Infinite
+ PauseAnimation { duration: 300 }
+ NumberAnimation { to: 1; duration: 700; easing.type: Easing.InOutSine }
+ PauseAnimation { duration: 1000 }
+ NumberAnimation { to: 0; duration: 700; easing.type: Easing.InOutSine }
+ PauseAnimation { duration: 1300 }
+ }
+ vertexShader: "
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ uniform highp float bend;
+ uniform highp float minimize;
+ uniform highp float side;
+ uniform highp float width;
+ uniform highp float height;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ varying highp vec2 qt_TexCoord0;
+ void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+ highp vec4 pos = qt_Vertex;
+ pos.y = mix(qt_Vertex.y, height, minimize);
+ highp float t = pos.y / height;
+ t = (3. - 2. * t) * t * t;
+ pos.x = mix(qt_Vertex.x, side * width, t * bend);
+ gl_Position = qt_ModelViewProjectionMatrix * pos;
+ }"
+ Slider {
+ id: genieSlider
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ height: 40
+ }
+ }
+ }
+}
diff --git a/doc/src/declarative/modules.qdoc b/doc/src/declarative/modules.qdoc
index dbc8806742..f2e24f2fa7 100644
--- a/doc/src/declarative/modules.qdoc
+++ b/doc/src/declarative/modules.qdoc
@@ -310,6 +310,7 @@ It is defined by a plain text file named "qmldir" that contains one or more line
<TypeName> [<InitialVersion>] <File>
internal <TypeName> <File>
plugin <Name> [<Path>]
+typeinfo <File>
\endcode
\bold {# <Comment>} lines are used for comments. They are ignored by the QML engine.
@@ -350,6 +351,14 @@ plugin file, or a relative path from the directory containing the \c qmldir file
containing the plugin file. By default the engine searches for the plugin library in the directory that contains the \c qmldir
file. The plugin search path can be queried with QDeclarativeEngine::pluginPathList() and modified using QDeclarativeEngine::addPluginPath(). When running the \l {QML Viewer}, use the \c -P option to add paths to the plugin search path.
+\bold {typeinfo <File>} lines add \l{Writing a qmltypes file}{type description files} to
+the module that can be read by QML tools such as Qt Creator to get information about the
+types defined by the module's plugins. <File> is the (relative) file name of a .qmltypes
+file.
+
+Without such a file QML tools may be unable to offer features such as code completion
+for the types defined in your plugins.
+
\section1 Debugging
@@ -358,5 +367,119 @@ when there are problems with finding and loading modules. See
\l{Debugging module imports} for more information.
+\section1 Writing a qmltypes file
+
+QML modules may refer to one or more type information files in their
+\l{Writing a qmldir file}{qmldir} file. These usually have the .qmltypes
+extension and are read by external tools to gain information about
+types defined in plugins.
+
+As such qmltypes files have no effect on the functionality of a QML module.
+Their only use is to allow tools such as Qt Creator to provide code completion,
+error checking and other functionality to users of your module.
+
+Any module that uses plugins should also ship a type description file.
+
+The best way to create a qmltypes file for your module is to generate it
+using the \c qmlplugindump tool that is provided with Qt.
+
+Example:
+If your module is in \c /tmp/imports/My/Module, you could run
+\code
+qmlplugindump My.Module 1.0 /tmp/imports > /tmp/imports/My/Module/mymodule.qmltypes
+\endcode
+to generate type information for your module. Afterwards, add the line
+\code
+typeinfo mymodule.qmltypes
+\endcode
+to \c /tmp/imports/My/Module/qmldir to register it.
+
+While the qmldump tool covers most cases, it does not work if:
+\list
+\o The plugin uses a \l{QDeclarativeCustomParser}. The component that uses
+ the custom parser will not get its members documented.
+\o The plugin can not be loaded. In particular if you cross-compiled
+ the plugin for a different architecture, qmldump will not be able to
+ load it.
+\endlist
+
+In case you have to create a qmltypes file manually or need to adjust
+an existing one, this is the file format:
+
+\qml
+import QtQuick.tooling 1.0
+
+// There always is a single Module object that contains all
+// Component objects.
+Module {
+ // A Component object directly corresponds to a type exported
+ // in a plugin with a call to qmlRegisterType.
+ Component {
+
+ // The name is a unique identifier used to refer to this type.
+ // It is recommended you simply use the C++ type name.
+ name: "QDeclarativeAbstractAnimation"
+
+ // The name of the prototype Component.
+ prototype: "QObject"
+
+ // The name of the default property.
+ defaultProperty: "animations"
+
+ // The name of the type containing attached properties
+ // and methods.
+ attachedType: "QDeclarativeAnimationAttached"
+
+ // The list of exports determines how a type can be imported.
+ // Each string has the format "URI/Name version" and matches the
+ // arguments to qmlRegisterType. Usually types are only exported
+ // once, if at all.
+ // If the "URI/" part of the string is missing that means the
+ // type should be put into the package defined by the URI the
+ // module was imported with.
+ // For example if this module was imported with 'import Foo 4.8'
+ // the Animation object would be found in the package Foo and
+ // QtQuick.
+ exports: [
+ "Animation 4.7",
+ "QtQuick/Animation 1.0"
+ ]
+
+ Property {
+ name: "animations";
+ type: "QDeclarativeAbstractAnimation"
+ // defaults to false, whether this property is read only
+ isReadonly: true
+ // defaults to false, whether the type of this property was a pointer in C++
+ isPointer: true
+ // defaults to false: whether the type actually is a QDeclarativeListProperty<type>
+ isList: true
+ }
+ Property { name: "loops"; type: "int" }
+ Property { name: "name"; type: "string" }
+ Property { name: "loopsEnum"; type: "Loops" }
+
+ Enum {
+ name: "Loops"
+ values: {
+ "Infinite": -2,
+ "OnceOnly": 1
+ }
+ }
+
+ // Signal and Method work the same way. The inner Parameter
+ // declarations also support the isReadonly, isPointer and isList
+ // attributes which mean the same as for Property
+ Method { name: "restart" }
+ Signal { name: "started" }
+ Signal {
+ name: "runningChanged"
+ Parameter { type: "bool" }
+ Parameter { name: "foo"; type: "bool" }
+ }
+ }
+}
+\endqml
+
*/
/
diff --git a/doc/src/declarative/qdeclarativeintro.qdoc b/doc/src/declarative/qdeclarativeintro.qdoc
index 02692de92c..ea2403ee76 100644
--- a/doc/src/declarative/qdeclarativeintro.qdoc
+++ b/doc/src/declarative/qdeclarativeintro.qdoc
@@ -320,6 +320,14 @@ Text {
In the element documentation grouped properties are shown using the 'dot' notation.
+While you can bind the entire group at once, like below, note that setting any of the
+grouped properties will result in setting the group and thus invalidate the binding.
+\qml
+Text {
+ font: otherText.font
+}
+\endqml
+
\section2 Attached Properties
\target attached-properties
diff --git a/doc/src/declarative/whatsnew.qdoc b/doc/src/declarative/whatsnew.qdoc
index 6eb1548ab2..bf4b0df086 100644
--- a/doc/src/declarative/whatsnew.qdoc
+++ b/doc/src/declarative/whatsnew.qdoc
@@ -29,6 +29,12 @@
\title What's new in Qt Quick
\page qtquick-whatsnew.html
+\section1 Qt 5.0.0 includes QtQuick 2.0
+
+QtQuick 2.0 is a major update.
+
+MouseArea now propagates clicked, doubleClicked and pressAndHold differently.
+
\section1 Qt 4.7.4 includes QtQuick 1.1
QtQuick 1.1 is a minor feature update. \e {import QtQuick 1.1} to use the new features.
diff --git a/doc/src/snippets/declarative/models/views-models-delegates.qml b/doc/src/snippets/declarative/models/views-models-delegates.qml
index 2f76856ca6..e02cb1a11f 100644
--- a/doc/src/snippets/declarative/models/views-models-delegates.qml
+++ b/doc/src/snippets/declarative/models/views-models-delegates.qml
@@ -37,6 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+import QtQuick 1.0
//! [rectangle]
Rectangle {
diff --git a/doc/src/snippets/declarative/models/visual-model-and-view.qml b/doc/src/snippets/declarative/models/visual-model-and-view.qml
index 4d42b6585c..824d57230f 100644
--- a/doc/src/snippets/declarative/models/visual-model-and-view.qml
+++ b/doc/src/snippets/declarative/models/visual-model-and-view.qml
@@ -37,6 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+import QtQuick 1.0
Rectangle {
width: 200; height: 200
diff --git a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
index 03473bafda..6f5b61a0b3 100644
--- a/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
+++ b/doc/src/snippets/declarative/mousearea/mousearea-snippet.qml
@@ -65,7 +65,6 @@ Rectangle {
//! [anchor fill]
Rectangle {
- id: button
width: 100; height: 100
//! [enable handlers]
@@ -79,7 +78,6 @@ Rectangle {
}
Rectangle {
- id: button
width: 100; height: 100
//! [mouse handlers]
diff --git a/doc/src/snippets/declarative/states/statechangescript.qml b/doc/src/snippets/declarative/states/statechangescript.qml
index aa1246d3fc..03d03f8a98 100644
--- a/doc/src/snippets/declarative/states/statechangescript.qml
+++ b/doc/src/snippets/declarative/states/statechangescript.qml
@@ -37,6 +37,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
import QtQuick 1.0
Item {
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
index 927294ade6..cbeb7e9e26 100644
--- a/examples/declarative/declarative.pro
+++ b/examples/declarative/declarative.pro
@@ -4,7 +4,8 @@ TEMPLATE = subdirs
SUBDIRS = \
cppextensions \
modelviews \
- tutorials
+ tutorials \
+ painteditem
# plugins uses a 'Time' class that conflicts with symbian e32std.h also defining a class of the same name
symbian:SUBDIRS -= plugins
diff --git a/examples/declarative/inputmethods/inputmethods.qmlproject b/examples/declarative/inputmethods/inputmethods.qmlproject
new file mode 100644
index 0000000000..d4909f8685
--- /dev/null
+++ b/examples/declarative/inputmethods/inputmethods.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.0
+
+Project {
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ /* List of plugin directories passed to QML runtime */
+ // importPaths: [ " ../exampleplugin " ]
+}
diff --git a/examples/declarative/inputmethods/spellcheck/Key.qml b/examples/declarative/inputmethods/spellcheck/Key.qml
new file mode 100644
index 0000000000..c95a3f0b2c
--- /dev/null
+++ b/examples/declarative/inputmethods/spellcheck/Key.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ property string text
+ property string displayText
+ property alias font: keyText.font
+ property int key: 0
+
+ id: root
+ radius: 2
+
+ width: 28
+ height: 28
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "darkgrey" }
+ GradientStop { position: 1.0; color: "grey" }
+ }
+
+ Text {
+ id: keyText
+
+ anchors.fill: parent
+
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ font.pixelSize: 18
+ font.capitalization: keyboard.shift && displayText == "" ? Font.AllUppercase : Font.MixedCase
+
+ text: root.displayText != "" ? root.displayText : root.text
+
+ style: !mouseArea.pressed ? Text.Raised : Text.Normal
+ color: "white"
+ styleColor: "grey"
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ anchors.fill: parent
+ onPressed: keyboard.keyPress(key, text)
+ onReleased: keyboard.keyRelease(key, text)
+ }
+}
diff --git a/examples/declarative/inputmethods/spellcheck/Keyboard.qml b/examples/declarative/inputmethods/spellcheck/Keyboard.qml
new file mode 100644
index 0000000000..533762e7ba
--- /dev/null
+++ b/examples/declarative/inputmethods/spellcheck/Keyboard.qml
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.inputcontext 1.0 as InputContext
+
+
+Rectangle {
+ id: keyboard
+
+ radius: 5
+ height: 122
+ width: 324
+
+ property bool shift: false
+
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightgrey" }
+ GradientStop { position: 1.0; color: "white" }
+ }
+
+ Column {
+ anchors.left: parent.left; anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: 2
+
+ Row {
+ spacing: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Key { key: Qt.Key_Q; text: "q"; }
+ Key { key: Qt.Key_W; text: "w"; }
+ Key { key: Qt.Key_E; text: "e"; }
+ Key { key: Qt.Key_R; text: "r"; }
+ Key { key: Qt.Key_T; text: "t"; }
+ Key { key: Qt.Key_Y; text: "y"; }
+ Key { key: Qt.Key_U; text: "u"; }
+ Key { key: Qt.Key_I; text: "i"; }
+ Key { key: Qt.Key_O; text: "o"; }
+ Key { key: Qt.Key_P; text: "p"; }
+ }
+ Row {
+ spacing: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Key { key: Qt.Key_A; text: "a"; }
+ Key { key: Qt.Key_S; text: "s"; }
+ Key { key: Qt.Key_D; text: "d"; }
+ Key { key: Qt.Key_F; text: "f"; }
+ Key { key: Qt.Key_G; text: "g"; }
+ Key { key: Qt.Key_H; text: "h"; }
+ Key { key: Qt.Key_J; text: "j"; }
+ Key { key: Qt.Key_K; text: "k"; }
+ Key { key: Qt.Key_L; text: "l"; }
+ }
+ Row {
+ spacing: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Key { key: Qt.Key_Shift; displayText: "shift"; width: 50 }
+ Key { key: Qt.Key_Z; text: "z"; }
+ Key { key: Qt.Key_X; text: "x"; }
+ Key { key: Qt.Key_C; text: "c"; }
+ Key { key: Qt.Key_V; text: "v"; }
+ Key { key: Qt.Key_B; text: "b"; }
+ Key { key: Qt.Key_N; text: "n"; }
+ Key { key: Qt.Key_M; text: "m"; }
+ Key { key: Qt.Key_Comma; text: ","; }
+ Key { key: Qt.Key_Period; text: "."; }
+ }
+
+ Row {
+ spacing: 2
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Key { key: Qt.Key_Enter; text: "\n"; displayText: "enter"; width: 90 }
+ Key { key: Qt.Key_Space; text: " "; displayText: "space"; width: 138}
+ Key { key: Qt.Key_Backspace; displayText: "backspace"; width: 90 }
+ }
+ }
+
+ function keyPress(key, text)
+ {
+ if (key == Qt.Key_Shift)
+ keyboard.shift = !keyboard.shift
+ else if (keyboard.shift)
+ InputContext.sendKeyPress(key, text.toUpperCase(), Qt.ShiftModifier)
+ else
+ InputContext.sendKeyPress(key, text)
+ }
+
+ function keyRelease(key, text)
+ {
+ if (key != Qt.Key_Shift) {
+ if (keyboard.shift) {
+ InputContext.sendKeyRelease(key, text.toUpperCase(), Qt.ShiftModifier)
+ keyboard.shift = false
+ } else {
+ InputContext.sendKeyRelease(key, text)
+ }
+ }
+ }
+}
diff --git a/examples/declarative/inputmethods/spellcheck/WordSuggestions.qml b/examples/declarative/inputmethods/spellcheck/WordSuggestions.qml
new file mode 100644
index 0000000000..5c4e9cb4a2
--- /dev/null
+++ b/examples/declarative/inputmethods/spellcheck/WordSuggestions.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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.inputcontext 1.0 as InputContext
+
+ListView {
+ property int globalX: InputContext.microFocus.x + ((InputContext.microFocus.width - width) / 2)
+ property int globalY: InputContext.microFocus.y + InputContext.microFocus.height
+
+ x: parent.mapToItem(null, globalX, globalY).x
+ y: parent.mapToItem(null, globalX, globalY).y
+
+ visible: suggestionModel.count > 0
+
+ width: 200
+ height: 70
+
+ InputContext.KeyFilter {
+ onPressed: event.accepted = filterKeyPress(event.key, event.text)
+ }
+
+ InputContext.MouseHandler {
+ onPressed: {
+ if (cursor < 0 || cursor >= InputContext.preeditText.length)
+ InputContext.commit()
+ }
+ }
+
+ model: XmlListModel {
+ id: suggestionModel
+
+ query: "/query/results/s:suggestion"
+ namespaceDeclarations: "declare namespace s=\"http://www.inktomi.com/\";"
+ source: InputContext.preeditText.length > 4 ? "http://query.yahooapis.com/v1/public/yql?q=select * from search.spelling where query=\"" + InputContext.preeditText + "\"" : ""
+
+ XmlRole { name: "suggestion"; query: "string()" }
+ }
+
+ delegate: Rectangle {
+ radius: 2
+ color: "lightsteelblue"
+
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ width: suggestionText.implicitWidth + 2
+ height: suggestionText.implicitHeight + 2
+
+ Text {
+ id: suggestionText
+
+ font: InputContext.font
+ text: suggestion
+
+ anchors.fill: parent
+ anchors.margins: 1
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: InputContext.commit(suggestion)
+ }
+ }
+}
diff --git a/examples/declarative/inputmethods/spellcheck/spellcheck.qml b/examples/declarative/inputmethods/spellcheck/spellcheck.qml
new file mode 100644
index 0000000000..57e81451a6
--- /dev/null
+++ b/examples/declarative/inputmethods/spellcheck/spellcheck.qml
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.inputcontext 1.0 as InputContext
+
+Item {
+ width: 360
+ height: 240
+
+ function filterKeyPress(key, text)
+ {
+ switch (key) {
+ case Qt.Key_Enter:
+ case Qt.Key_Return:
+ case Qt.Key_Space:
+ case Qt.Key_Tab:
+ if (InputContext.preeditText != "")
+ InputContext.commit();
+ break;
+ case Qt.Key_Backspace:
+ if (InputContext.preeditText != "") {
+ InputContext.preeditText = InputContext.preeditText.substr(0, InputContext.preeditText.length - 1);
+ return true;
+ }
+ break;
+ default:
+ if (text != "") {
+ InputContext.preeditText += text
+ return true;
+ } else if (InputContext.preeditText != "") {
+ InputContext.commit();
+ }
+ break;
+ }
+ return false;
+ }
+
+ Rectangle {
+ anchors.left: parent.left; anchors.top: parent.top; anchors.right: parent.right;
+ anchors.bottom: keyboard.top
+ anchors.margins: 2
+
+ border.width: 1
+ radius: 2
+
+ TextEdit {
+ id: textEdit
+
+ wrapMode: TextEdit.WordWrap
+
+ anchors.fill: parent
+ anchors.margins: 2
+ }
+
+ MouseArea {
+ anchors.fill: textEdit
+
+ onPressed: {
+ mouse.accepted = false
+ var position = textEdit.positionAt(mouse.x, mouse.y);
+ if (position != textEdit.cursorPosition) {
+ InputContext.commit()
+ textEdit.cursorPosition = textEdit.positionAt(mouse.x, mouse.y)
+ textEdit.selectWord()
+ var word = textEdit.selectedText
+ if (word != "") {
+ InputContext.commit("");
+ InputContext.preeditText = word;
+ }
+ }
+ }
+ }
+ }
+
+ WordSuggestions {}
+
+ Keyboard {
+ id: keyboard
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ y: parent.height
+
+ states: [
+ State {
+ name: "visible"
+ PropertyChanges { target: keyboard; y: parent.height - height }
+ when: InputContext.softwareInputPanelVisible
+ },
+ State {
+ name: "hidden"
+ PropertyChanges { target: keyboard; y: parent.height }
+ when: !InputContext.softwareInputPanelVisible
+ }
+ ]
+ transitions: Transition {
+ NumberAnimation { properties: "y"; easing.type: Easing.InOutQuad; duration: 100 }
+ }
+ }
+}
diff --git a/examples/declarative/painteditem/main.cpp b/examples/declarative/painteditem/main.cpp
new file mode 100644
index 0000000000..10bd4302c9
--- /dev/null
+++ b/examples/declarative/painteditem/main.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/qapplication.h>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qsgview.h>
+#include <QtDeclarative/qsgpainteditem.h>
+
+class MyPaintItem : public QSGPaintedItem
+{
+ Q_OBJECT
+public:
+ MyPaintItem() : QSGPaintedItem()
+ {
+ setAntialiasing(true);
+ }
+
+ virtual void paint(QPainter *p)
+ {
+ QRectF rect(0, 0, width(), height());
+ rect.adjust(10, 10, -10, -10);
+ p->setPen(QPen(Qt::black, 20));
+ p->setBrush(Qt::yellow);
+ p->drawEllipse(rect);
+ p->setPen(Qt::black);
+ p->setFont(QFont(QLatin1String("Times"), qRound(rect.height() / 2)));
+ p->drawText(rect, Qt::AlignCenter, QLatin1String(":-)"));
+ }
+};
+
+int main(int argc, char ** argv)
+{
+ QApplication app(argc, argv);
+
+ qmlRegisterType<MyPaintItem>("MyModule", 1, 0, "MyPaintItem");
+
+ QGLFormat f = QGLFormat::defaultFormat();
+ f.setSampleBuffers(true);
+ QSGView view(f);
+ view.setResizeMode(QSGView::SizeRootObjectToView);
+ view.setSource(QUrl::fromLocalFile("myfile.qml"));
+ view.show();
+ view.raise();
+
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/examples/declarative/painteditem/myfile.qml b/examples/declarative/painteditem/myfile.qml
new file mode 100644
index 0000000000..bc4bd2664b
--- /dev/null
+++ b/examples/declarative/painteditem/myfile.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import MyModule 1.0
+
+Rectangle {
+ width: 480
+ height: 480
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#00249a" }
+ GradientStop { position: 0.7; color: "#ffd94f" }
+ GradientStop { position: 1.0; color: "#ffa322" }
+ }
+ MyPaintItem {
+ anchors.fill: parent
+ anchors.margins: 10
+ smooth: true
+ }
+}
diff --git a/examples/declarative/painteditem/painteditem.pro b/examples/declarative/painteditem/painteditem.pro
new file mode 100644
index 0000000000..5d7b9df074
--- /dev/null
+++ b/examples/declarative/painteditem/painteditem.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+TARGET = painteditem
+
+QT += declarative
+
+macx: CONFIG -= app_bundle
+
+SOURCES += main.cpp
+
+CONFIG += console
+
+symbian {
+ TARGET.EPOCHEAPSIZE = 0x20000 0x5000000
+}
diff --git a/examples/declarative/particles/allsmiles/content/particle.png b/examples/declarative/particles/allsmiles/content/particle.png
new file mode 100644
index 0000000000..5c83896d22
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/particle.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/singlesmile.png b/examples/declarative/particles/allsmiles/content/singlesmile.png
new file mode 100644
index 0000000000..4087fa6b7f
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/singlesmile.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/sizeInOut.png b/examples/declarative/particles/allsmiles/content/sizeInOut.png
new file mode 100644
index 0000000000..0a306ea21a
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/sizeInOut.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/smileMask.png b/examples/declarative/particles/allsmiles/content/smileMask.png
new file mode 100644
index 0000000000..65a0143e9e
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/smileMask.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite.png b/examples/declarative/particles/allsmiles/content/squarefacesprite.png
new file mode 100644
index 0000000000..f9a5d5fcce
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite2.png b/examples/declarative/particles/allsmiles/content/squarefacesprite2.png
new file mode 100644
index 0000000000..7106a520a4
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite2.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite3.png b/examples/declarative/particles/allsmiles/content/squarefacesprite3.png
new file mode 100644
index 0000000000..f4e6f26856
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite3.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite4.png b/examples/declarative/particles/allsmiles/content/squarefacesprite4.png
new file mode 100644
index 0000000000..1e094eed4a
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite4.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite5.png b/examples/declarative/particles/allsmiles/content/squarefacesprite5.png
new file mode 100644
index 0000000000..1cfc5c7f8c
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite5.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite6.png b/examples/declarative/particles/allsmiles/content/squarefacesprite6.png
new file mode 100644
index 0000000000..b040139a9e
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite6.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacesprite7.png b/examples/declarative/particles/allsmiles/content/squarefacesprite7.png
new file mode 100644
index 0000000000..b1e5e4e339
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacesprite7.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacespriteX.png b/examples/declarative/particles/allsmiles/content/squarefacespriteX.png
new file mode 100644
index 0000000000..93a0181dd0
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacespriteX.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/content/squarefacespriteXX.png b/examples/declarative/particles/allsmiles/content/squarefacespriteXX.png
new file mode 100644
index 0000000000..3159efe246
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/content/squarefacespriteXX.png
Binary files differ
diff --git a/examples/declarative/particles/allsmiles/smile.qml b/examples/declarative/particles/allsmiles/smile.qml
new file mode 100644
index 0000000000..e37e8fa98e
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/smile.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ color: "white"
+ width: 310
+ height: 300
+ ParticleSystem{ id: sys }
+ Picture{
+ system: sys
+ anchors.fill: parent
+ image: "content/singlesmile.png"
+ onceOff: true
+ }
+ ColoredParticle{
+ system: sys
+ image: "content/particle.png"
+ color: "black"
+ alpha: 0.4
+ sizeTable: "content/sizeInOut.png"
+ }
+ TrailEmitter{
+ id: emitter
+ system: sys
+ emitting: false
+ particleDuration: 4000
+ maxParticles: 1200
+ anchors.fill: parent
+ particleSize: 32
+ speed: PointVector{ xVariation: 12; yVariation: 12 }
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: emitter.burst(1200);
+ }
+}
+
diff --git a/examples/declarative/particles/allsmiles/smilefactory.qml b/examples/declarative/particles/allsmiles/smilefactory.qml
new file mode 100644
index 0000000000..47becb50fe
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/smilefactory.qml
@@ -0,0 +1,118 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ color: "goldenrod"
+ width: 400
+ height: 400
+ ParticleSystem{id:sys}
+ DeformableParticle{
+ system: sys
+ particles: ["goingLeft", "goingRight"]
+ image: "content/singlesmile.png"
+ rotation: 90
+ rotationSpeed: 90
+ autoRotation: true
+ }
+ DeformableParticle{
+ system: sys
+ particles: ["goingDown"]
+ image: "content/squarefacespriteXX.png"
+ rotation: 180
+ yVector: PointVector{ y: 0.5; yVariation: 0.25; xVariation: 0.25; }
+ }
+ Timer{
+ running: true
+ repeat: false
+ interval: 100
+ onTriggered: emitA.emitting = true;
+ }
+ Timer{
+ running: true
+ repeat: false
+ interval: 4200
+ onTriggered: emitB.emitting = true;
+ }
+ Timer{
+ running: true
+ repeat: false
+ interval: 8400
+ onTriggered: emitC.emitting = true;
+ }
+ TrailEmitter{
+ id: emitA
+ x: 0
+ y: 120
+ system: sys
+ emitting: false
+ particle: "goingRight"
+ speed: PointVector{ x: 100 }
+ particleDuration: 4000
+ particlesPerSecond: 2
+ particleSize: 32
+ }
+ TrailEmitter{
+ id: emitB
+ x: 400
+ y: 240
+ system: sys
+ emitting: false
+ particle: "goingLeft"
+ speed: PointVector{ x: -100 }
+ particleDuration: 4000
+ particlesPerSecond: 2
+ particleSize: 32
+ }
+ TrailEmitter{
+ id: emitC
+ x: 0
+ y: 360
+ system: sys
+ emitting: false
+ particle: "goingDown"
+ speed: PointVector{ x: 100 }
+ particleDuration: 4000
+ particlesPerSecond: 2
+ particleSize: 32
+ }
+}
diff --git a/examples/declarative/particles/allsmiles/spriteparticles.qml b/examples/declarative/particles/allsmiles/spriteparticles.qml
new file mode 100644
index 0000000000..4bcb7081b8
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/spriteparticles.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ color: "goldenrod"
+ width: 400
+ height: 400
+ ColoredParticle{
+ id: test
+ particles: ["Test"]
+ image: "content/particle.png"
+ system: sys
+ z: 2
+ anchors.fill: parent
+ color: "#336666CC"
+ colorVariation: 0.0
+ }
+ SpriteParticle{
+ id: single
+ particles: ["Face"]
+ system: sys
+ z: 2
+ anchors.fill: parent
+ Sprite{
+ source: "content/squarefacesprite.png"
+ frames: 6
+ duration: 120
+ }
+ }
+ Mask{
+ id: mask
+ source: "content/smileMask.png"
+ }
+ TrailEmitter{
+ system: sys
+ particle: "Test"
+ anchors.fill: parent
+ id: particles2
+ particlesPerSecond: 6000
+ particleDuration: 720
+ emitting: true
+ particleSize: 10
+ shape: mask
+ }
+ TrailEmitter{
+ system: sys
+ particle: "Face"
+ anchors.fill: parent
+ id: particles
+ particlesPerSecond: 60
+ particleDuration: 1440
+ emitting: true
+ speed: PointVector{xVariation: 10; yVariation: 10;}
+ particleSize: 30
+ particleSizeVariation: 10
+ shape: mask
+ }
+ ParticleSystem{
+ id: sys
+ anchors.fill: parent
+ }
+
+}
diff --git a/examples/declarative/particles/allsmiles/spritestateparticles.qml b/examples/declarative/particles/allsmiles/spritestateparticles.qml
new file mode 100644
index 0000000000..6a61487a89
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/spritestateparticles.qml
@@ -0,0 +1,190 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ color: "goldenrod"
+ width: 800
+ height: 800
+ id: root
+ SpriteImage{
+ sprites: [Sprite{
+ name: "happy"
+ source: "content/squarefacesprite2.png"
+ frames: 6
+ duration: 120
+ to: {"silly": 0.4, "sad": 0.2, "cyclops":0.1, "boggled":0.3, "dying":0.0}
+ }, Sprite{
+ name: "silly"
+ source: "content/squarefacesprite.png"
+ frames: 6
+ duration: 120
+ to: {"love": 0.4, "happy": 0.1, "evil": 0.2, "cyclops":0.1, "boggled":0.2}
+ }, Sprite{
+ name: "sad"
+ source: "content/squarefacesprite3.png"
+ frames: 6
+ duration: 120
+ to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.2, "boggled":0.2}
+ }, Sprite{
+ name: "cyclops"
+ source: "content/squarefacesprite4.png"
+ frames: 6
+ duration: 120
+ to: {"love": 0.1, "evil": 0.1, "silly":0.1, "boggled":0.1, "cyclops" : 1.0}
+ }, Sprite{
+ name: "evil"
+ source: "content/squarefacesprite5.png"
+ frames: 6
+ duration: 120
+ to: {"happy": 1.0}
+ }, Sprite{
+ name: "love"
+ source: "content/squarefacesprite6.png"
+ frames: 6
+ duration: 120
+ to: {"sad": 0.6, "evil":0.4, "boggled":0.2}
+ }, Sprite{
+ name: "boggled"
+ source: "content/squarefacesprite7.png"
+ frames: 6
+ duration: 120
+ to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.1, "sad":0.2}
+ }, Sprite{
+ name: "dying"
+ source: "content/squarefacespriteX.png"
+ frames: 4
+ duration: 120
+ to: {"dead":1.0}
+ }, Sprite{
+ name: "dead"
+ source: "content/squarefacespriteXX.png"
+ frames: 1
+ duration: 10000
+ }]
+
+ width: 100
+ height: 100
+ x: 20
+ y: 20
+ z:4
+ }
+ ParticleSystem{ id: sys }
+ SpriteParticle{
+ anchors.fill: parent
+ id: particles
+ system: sys
+ sprites: [Sprite{
+ name: "happy"
+ source: "content/squarefacesprite2.png"
+ frames: 6
+ duration: 120
+ to: {"silly": 0.4, "sad": 0.2, "cyclops":0.1, "boggled":0.3, "dying":0.0}
+ }, Sprite{
+ name: "silly"
+ source: "content/squarefacesprite.png"
+ frames: 6
+ duration: 120
+ to: {"love": 0.4, "happy": 0.1, "evil": 0.2, "cyclops":0.1, "boggled":0.2}
+ }, Sprite{
+ name: "sad"
+ source: "content/squarefacesprite3.png"
+ frames: 6
+ duration: 120
+ to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.2, "boggled":0.2}
+ }, Sprite{
+ name: "cyclops"
+ source: "content/squarefacesprite4.png"
+ frames: 6
+ duration: 120
+ to: {"love": 0.1, "evil": 0.1, "silly":0.1, "boggled":0.1, "cyclops" : 1.0}
+ }, Sprite{
+ name: "evil"
+ source: "content/squarefacesprite5.png"
+ frames: 6
+ duration: 120
+ to: {"happy": 1.0}
+ }, Sprite{
+ name: "love"
+ source: "content/squarefacesprite6.png"
+ frames: 6
+ duration: 120
+ to: {"sad": 0.6, "evil":0.4, "boggled":0.2}
+ }, Sprite{
+ name: "boggled"
+ source: "content/squarefacesprite7.png"
+ frames: 6
+ duration: 120
+ to: {"love" : 0.2, "evil": 0.2, "silly": 0.2, "cyclops":0.1, "sad":0.2}
+ }, Sprite{
+ name: "dying"
+ source: "content/squarefacespriteX.png"
+ frames: 4
+ duration: 120
+ to: {"dead":1.0}
+ }, Sprite{
+ name: "dead"
+ source: "content/squarefacespriteXX.png"
+ frames: 1
+ duration: 10000
+ }]
+ }
+ TrailEmitter{
+ system: sys
+ particlesPerSecond: 16
+ particleDuration: 10000
+ emitting: true
+ speed: AngleVector{angle: 90; magnitude: 60; angleVariation: 5}
+ acceleration: PointVector{ y: 10 }
+ particleSize: 30
+ particleSizeVariation: 10
+ width: parent.width
+ height: 100
+ }
+ SpriteGoal{
+ system: sys
+ width: root.width;
+ height: root.height/2;
+ y: root.height/2;
+ goalState:"dead"
+ }
+}
diff --git a/examples/declarative/particles/allsmiles/spritevariedparticles.qml b/examples/declarative/particles/allsmiles/spritevariedparticles.qml
new file mode 100644
index 0000000000..c1b773093f
--- /dev/null
+++ b/examples/declarative/particles/allsmiles/spritevariedparticles.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ color: "goldenrod"
+ width: 800
+ height: 800
+ ParticleSystem{ id: sys }
+ SpriteParticle{
+ system: sys
+ anchors.fill: parent
+ sprites: [Sprite{
+ name: "initial"
+ source: "content/squarefacesprite.png"
+ frames: 6
+ duration: 0
+ to: {"happy":0.2, "silly":0.2, "sad":0.2, "cyclops":0.1, "evil":0.1, "love":0.1, "boggled":0.1}
+ }, Sprite{
+ name: "silly"
+ source: "content/squarefacesprite.png"
+ frames: 6
+ duration: 120
+ }, Sprite{
+ name: "happy"
+ source: "content/squarefacesprite2.png"
+ frames: 6
+ duration: 120
+ }, Sprite{
+ name: "sad"
+ source: "content/squarefacesprite3.png"
+ frames: 6
+ duration: 120
+ }, Sprite{
+ name: "cyclops"
+ source: "content/squarefacesprite4.png"
+ frames: 6
+ duration: 120
+ }, Sprite{
+ name: "evil"
+ source: "content/squarefacesprite5.png"
+ frames: 6
+ duration: 120
+ }, Sprite{
+ name: "love"
+ source: "content/squarefacesprite6.png"
+ frames: 6
+ duration: 120
+ }, Sprite{
+ name: "boggled"
+ source: "content/squarefacesprite7.png"
+ frames: 6
+ duration: 120
+ }]
+ }
+ TrailEmitter{
+ id: particleEmitter
+ system: sys
+ width: parent.width
+ particlesPerSecond: 16
+ particleDuration: 8000
+ emitting: true
+ speed: AngleVector{angle: 90; magnitude: 300; magnitudeVariation: 100; angleVariation: 5}
+ acceleration: PointVector{ y: 10 }
+ particleSize: 30
+ particleSizeVariation: 10
+ }
+ Binding{
+ target: particleEmitter
+ property: "y"
+ value: ma.mouseY
+ when: ma.mouseX !=0 || ma.mouseY!=0
+ }
+ MouseArea{
+ id: ma
+ anchors.fill: parent
+ }
+}
diff --git a/examples/declarative/particles/asteroid/asteroid.qml b/examples/declarative/particles/asteroid/asteroid.qml
new file mode 100644
index 0000000000..b5b4f672c2
--- /dev/null
+++ b/examples/declarative/particles/asteroid/asteroid.qml
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt.labs.particles 2.0
+import Qt.labs.particles 2.0 as Qlp
+import QtQuick 2.0
+
+Item {
+ id: root
+ width: 360
+ height: 540
+ MouseArea{
+ id: ma
+ anchors.fill: parent
+ }
+
+ ParticleSystem { id: sys }
+ Image {
+ source: "content/finalfrontier.png"
+ transformOrigin: Item.Center
+ anchors.centerIn: parent
+ smooth: true
+ NumberAnimation on rotation {
+ from: 0
+ to: 360
+ duration: 200000
+ loops: Animation.Infinite
+ }
+
+ }
+ ColoredParticle {
+ system: sys
+ particles: ["starfield"]
+ image: "content/star.png"
+ colorVariation: 0.3
+ color: "white"
+ }
+ TrailEmitter {
+ id: starField
+ system: sys
+ particle: "starfield"
+
+ particlesPerSecond: 80
+ particleDuration: 2500
+
+ anchors.centerIn: parent
+
+ //acceleration: AngleVector{angleVariation: 360; magnitude: 200}//Is this a better effect, more consistent speed?
+ acceleration: PointVector{ xVariation: 200; yVariation: 200; }
+
+ particleSize: 0
+ particleEndSize: 80
+ particleSizeVariation: 10
+ }
+ TrailEmitter{
+ system: sys
+ particle: "meteor"
+ particlesPerSecond: 12
+ particleDuration: 5000
+ emitting: true
+ acceleration: PointVector{ xVariation: 80; yVariation: 80; }
+ particleSize: 15
+ particleEndSize: 300
+ anchors.centerIn: parent
+ }
+ SpriteParticle{
+ system: sys
+ particles: ["meteor"]
+ sprites:[Sprite{
+ id: spinState
+ name: "spinning"
+ source: "content/meteor.png"
+ frames: 35
+ duration: 40
+ speedModifiesDuration: -0.1
+ to: {"explode":0, "spinning":1}
+ },Sprite{
+ name: "explode"
+ source: "content/_explo.png"
+ frames: 22
+ duration: 40
+ speedModifiesDuration: -0.1
+ to: {"nullFrame":1}
+ },Sprite{//Not sure if this is needed, but seemed easiest
+ name: "nullFrame"
+ source: "content/nullRock.png"
+ frames: 1
+ duration: 1000
+ }
+ ]
+ }
+ SpriteGoal{
+ particles: ["meteor"]
+ system: sys
+ goalState: "explode"
+ jump: true
+ anchors.centerIn: holder//A bug in affectors currently isn't compensating for relative x,y. when that's fixed this can just anchors.fill: rocketShip
+ width: 60
+ height: 60
+ }
+ Image {
+ id: rocketShip
+ source: "content/rocket.png"
+ smooth: true
+ anchors.centerIn: holder
+ rotation: (circle.percent+0.25) * 360
+ z: 2
+ }
+ Item {
+ id: holder
+ x: circle.x - Math.sin(circle.percent * 6.28316530714)*200
+ y: circle.y + Math.cos(circle.percent * 6.28316530714)*200
+ z: 1
+ }
+
+ Item {
+ id: circle
+ x: root.width / 1.2
+ y: root.height / 1.7
+ property real percent: 0
+
+ SequentialAnimation on percent {
+ id: circleAnim1
+ loops: Animation.Infinite
+ running: true
+ NumberAnimation {
+ duration: 4000
+ from: 1
+ to: 0
+ }
+
+ }
+ }
+ ColoredParticle{
+ z:0
+ system: sys
+ particles: ["exhaust"]
+ image: "content/particle4.png"
+
+ color: "orange"
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation {
+ from: "red"
+ to: "cyan"
+ duration: 1000
+ }
+ ColorAnimation {
+ from: "cyan"
+ to: "red"
+ duration: 1000
+ }
+ }
+
+ colorVariation: 0.2
+ }
+ TrailEmitter{
+ id: trailsNormal2
+ system: sys
+ particle: "exhaust"
+
+ particlesPerSecond: 300
+ particleDuration: 500
+
+ y: holder.y
+ x: holder.x
+
+ speed: PointVector{ xVariation: 40; yVariation: 40; }
+ speedFromMovement: 16
+
+ acceleration: PointVector{ xVariation: 10; yVariation: 10; }
+
+ particleSize: 4
+ particleSizeVariation: 4
+ }
+}
diff --git a/examples/declarative/particles/asteroid/blackhole.qml b/examples/declarative/particles/asteroid/blackhole.qml
new file mode 100644
index 0000000000..68d5835880
--- /dev/null
+++ b/examples/declarative/particles/asteroid/blackhole.qml
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ id: root
+ width: 360
+ height: 540
+ color: "black"
+ property bool spacePressed: false
+ focus: true
+ Image{
+ source: "content/finalfrontier.png"
+ anchors.centerIn:parent
+ }
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Space) {
+ spacePressed = true;
+ event.accepted = true;
+ }
+ }
+ Keys.onReleased: {
+ if (event.key == Qt.Key_Space) {
+ spacePressed = false;
+ event.accepted = true;
+ }
+ }
+
+ TrailEmitter{
+ particle: "stars"
+ system: particles
+ particlesPerSecond: 40
+ particleDuration: 4000
+ emitting: true
+ particleSize: 30
+ particleSizeVariation: 10
+ speed: PointVector{ x: 220; xVariation: 40 }
+ height: parent.height
+ }
+ TrailEmitter{
+ particle: "roids"
+ system: particles
+ particlesPerSecond: 10
+ particleDuration: 4000
+ emitting: true
+ particleSize: 30
+ particleSizeVariation: 10
+ speed: PointVector{ x: 220; xVariation: 40 }
+ height: parent.height
+ }
+ ParticleSystem{
+ id: particles
+ anchors.fill: parent
+ }
+ ColoredParticle{
+ id: stars
+ particles: ["stars"]
+ system: particles
+ image: "content/star.png"
+ color: "white"
+ colorVariation: 0.1
+ }
+ SpriteParticle{
+ id: roids
+ particles: ["roids"]
+ system: particles
+ sprites: Sprite{
+ id: spinState
+ name: "spinning"
+ source: "content/meteor.png"
+ frames: 35
+ duration: 60
+ speedModifiesDuration: -0.1
+ }
+ }
+ ColoredParticle{
+ id: shot
+ particles: ["shot"]
+ system: particles
+ image: "content/star.png"
+
+ color: "#0FF06600"
+ colorVariation: 0.3
+ }
+ ColoredParticle{
+ id: engine
+ particles: ["engine"]
+ system: particles
+ image: "content/particle4.png"
+
+ color: "orange"
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation {
+ from: "red"
+ to: "cyan"
+ duration: 1000
+ }
+ ColorAnimation {
+ from: "cyan"
+ to: "red"
+ duration: 1000
+ }
+ }
+
+ colorVariation: 0.2
+ }
+ GravitationalSingularity{
+ id: gs; x: root.width/2; y: root.height/2; strength: 4000000;
+ system: particles
+ }
+ Kill{
+ system: particles
+ x: gs.x - 8;
+ y: gs.y - 8;
+ width: 16
+ height: 16
+ }
+ Image{
+ source:"content/rocket2.png"
+ id: ship
+ width: 45
+ height: 22
+ MouseArea{
+ id: ma
+ anchors.fill: parent;
+ drag.axis: Drag.XandYAxis
+ drag.target: ship
+ }
+ TrailEmitter{
+ particle: "engine"
+ system: particles
+ particlesPerSecond: 200
+ particleDuration: 1000
+ emitting: true
+ particleSize: 10
+ particleEndSize: 4
+ particleSizeVariation: 4
+ speed: PointVector{ x: -128; xVariation: 32 }
+ height: parent.height
+ width: 20
+ }
+ TrailEmitter{
+ particle: "shot"
+ system: particles
+ particlesPerSecond: 32
+ particleDuration: 2000
+ emitting: spacePressed
+ particleSize: 40
+ speed: PointVector{ x: 256; }
+ x: parent.width
+ y: parent.height/2
+ }
+ }
+ Text{
+ color: "white"
+ anchors.bottom: parent.bottom
+ text:"Drag the ship, Spacebar to fire."
+ }
+}
+
diff --git a/examples/declarative/particles/asteroid/content/_explo.png b/examples/declarative/particles/asteroid/content/_explo.png
new file mode 100644
index 0000000000..4297245d49
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/_explo.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/finalfrontier.png b/examples/declarative/particles/asteroid/content/finalfrontier.png
new file mode 100644
index 0000000000..2ba1815230
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/finalfrontier.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/meteor.png b/examples/declarative/particles/asteroid/content/meteor.png
new file mode 100644
index 0000000000..e8c368aea7
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/meteor.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/meteor_explo.png b/examples/declarative/particles/asteroid/content/meteor_explo.png
new file mode 100644
index 0000000000..e659bfe2cf
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/meteor_explo.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/meteors.png b/examples/declarative/particles/asteroid/content/meteors.png
new file mode 100644
index 0000000000..bada8a1407
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/meteors.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/nullRock.png b/examples/declarative/particles/asteroid/content/nullRock.png
new file mode 100644
index 0000000000..4076327a1a
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/nullRock.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/particle4.png b/examples/declarative/particles/asteroid/content/particle4.png
new file mode 100644
index 0000000000..bc95b703c1
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/particle4.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/rocket.png b/examples/declarative/particles/asteroid/content/rocket.png
new file mode 100644
index 0000000000..a171610b03
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/rocket.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/rocket2.png b/examples/declarative/particles/asteroid/content/rocket2.png
new file mode 100644
index 0000000000..7110f8fdc6
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/rocket2.png
Binary files differ
diff --git a/examples/declarative/particles/asteroid/content/star.png b/examples/declarative/particles/asteroid/content/star.png
new file mode 100644
index 0000000000..0d592cfa87
--- /dev/null
+++ b/examples/declarative/particles/asteroid/content/star.png
Binary files differ
diff --git a/examples/declarative/particles/modelparticles/bubbles.qml b/examples/declarative/particles/modelparticles/bubbles.qml
new file mode 100644
index 0000000000..711d52d522
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/bubbles.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "../../modelviews/listview/content" as OtherDemo
+import "content/script.js" as Script
+import "content"
+//Needs OtherDemo to be updated to QtQuick 2.0
+
+Item{
+ id: root
+ width: 400
+ height: 400
+ Rectangle{
+ anchors.fill: parent
+ color: "lightsteelblue"
+ }
+ ParticleSystem{
+ id: sys;
+ }
+ TrailEmitter{
+ system: sys
+ particle: "A"
+ width: parent.width/2
+ x: parent.width/4
+ y:parent.height
+ speed: PointVector{ y: -64; yVariation: 16 }
+ particlesPerSecond: 1
+ particleDuration: 8000
+ }
+ Drift{
+ system: sys
+ xDrift: 200
+ }
+ ModelParticle{
+ id: mp
+ z: 0
+ system: sys
+ particles: ["A"]
+ model: OtherDemo.RecipesModel{}
+ delegate: ExpandingDelegate{}
+ }
+}
diff --git a/examples/declarative/particles/modelparticles/content/Delegate.qml b/examples/declarative/particles/modelparticles/content/Delegate.qml
new file mode 100644
index 0000000000..ae1dffb63b
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/content/Delegate.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+//![0]
+Package {
+ Text { id: listDelegate; width: 200; height: 25; text: 'Empty'; Package.name: 'list' }
+ Text { id: gridDelegate; width: 100; height: 50; text: 'Empty'; Package.name: 'grid' }
+
+ Rectangle {
+ id: wrapper
+ width: 200; height: 25
+ color: 'lightsteelblue'
+
+ Text { text: display; anchors.centerIn: parent }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (wrapper.state == 'inList')
+ wrapper.state = 'inGrid';
+ else
+ wrapper.state = 'inList';
+ }
+ }
+
+ state: 'inList'
+ states: [
+ State {
+ name: 'inList'
+ ParentChange { target: wrapper; parent: listDelegate }
+ },
+ State {
+ name: 'inGrid'
+ ParentChange {
+ target: wrapper; parent: gridDelegate
+ x: 0; y: 0; width: gridDelegate.width; height: gridDelegate.height
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParentAnimation {
+ NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
+ }
+ }
+ ]
+ }
+}
+//![0]
diff --git a/examples/declarative/particles/modelparticles/content/Delegate2.qml b/examples/declarative/particles/modelparticles/content/Delegate2.qml
new file mode 100644
index 0000000000..a05fa348b9
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/content/Delegate2.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+//![0]
+Package {
+ Item { id: gridDelegate; width: w; height: h; Package.name: 'grid' }
+ Item { id: particleDelegate; width: w; height: h; Package.name: 'particles'
+
+ Rectangle {
+ id: wrapper
+ width: w; height: h;
+ color: col
+ rotation: Math.random()*360
+ Behavior on rotation{RotationAnimation{}}
+
+ states: State{
+ name: "gridded"
+ when: root.inGrid
+ PropertyChanges{
+ target: wrapper
+ rotation: 0
+ }
+ ParentChange{
+ target: wrapper
+ parent: gridDelegate
+ x:0
+ y:0
+ }
+ }
+ transitions: [
+ Transition {
+ ParentAnimation {
+ NumberAnimation { properties: 'x,y,width,height'; duration: 300 }
+ }
+ }
+ ]
+ }
+ }
+}
+//![0]
diff --git a/examples/declarative/particles/modelparticles/content/ExpandingDelegate.qml b/examples/declarative/particles/modelparticles/content/ExpandingDelegate.qml
new file mode 100644
index 0000000000..e6fcb6dcf7
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/content/ExpandingDelegate.qml
@@ -0,0 +1,204 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import "../../../modelviews/listview/content"
+
+// This example illustrates expanding a list item to show a more detailed view.
+
+ // Delegate for the recipes. This delegate has two modes:
+ // 1. List mode (default), which just shows the picture and title of the recipe.
+ // 2. Details mode, which also shows the ingredients and method.
+ Component {
+ id: recipeDelegate
+
+ Item {
+ id: recipe
+
+ // Create a property to contain the visibility of the details.
+ // We can bind multiple element's opacity to this one property,
+ // rather than having a "PropertyChanges" line for each element we
+ // want to fade.
+ property real detailsOpacity : 0
+
+ //this bit changed for aesthetics
+ width: 70
+ height: 70
+ // A simple rounded rectangle for the background
+ Rectangle {
+ id: background
+ x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
+ color: "ivory"
+ border.color: "orange"
+ radius: 5
+ }
+ Image{
+ anchors.fill:parent
+ anchors.margins: -32
+ source: "bubble.png"
+ }
+
+
+ // This mouse region covers the entire delegate.
+ // When clicked it changes mode to 'Details'. If we are already
+ // in Details mode, then no change will happen.
+ MouseArea {
+ anchors.fill: parent
+ onClicked: recipe.state = 'Details';
+ }
+
+ // Lay out the page: picture, title and ingredients at the top, and method at the
+ // bottom. Note that elements that should not be visible in the list
+ // mode have their opacity set to recipe.detailsOpacity.
+ Row {
+ id: topLayout
+ x: 10; y: 10; height: recipeImage.height; width: parent.width
+ spacing: 10
+
+ Image {
+ id: recipeImage
+ width: 50; height: 50
+ source: "../../modelviews/listview/" + picture
+ }
+
+ Column {
+ width: background.width - recipeImage.width - 20; height: recipeImage.height
+ spacing: 5
+
+ Text {
+ text: title
+ font.bold: true; font.pointSize: 16
+ }
+
+ Text {
+ text: "Ingredients"
+ font.pointSize: 12; font.bold: true
+ opacity: recipe.detailsOpacity
+ }
+
+ Text {
+ text: ingredients
+ wrapMode: Text.WordWrap
+ width: parent.width
+ opacity: recipe.detailsOpacity
+ }
+ }
+ }
+
+ Item {
+ id: details
+ x: 10; width: parent.width - 20
+ anchors { top: topLayout.bottom; topMargin: 10; bottom: parent.bottom; bottomMargin: 10 }
+ opacity: recipe.detailsOpacity
+
+ Text {
+ id: methodTitle
+ anchors.top: parent.top
+ text: "Method"
+ font.pointSize: 12; font.bold: true
+ }
+
+ Flickable {
+ id: flick
+ width: parent.width
+ anchors { top: methodTitle.bottom; bottom: parent.bottom }
+ contentHeight: methodText.height
+ clip: true
+
+ Text { id: methodText; text: method; wrapMode: Text.WordWrap; width: details.width }
+ }
+
+ Image {
+ anchors { right: flick.right; top: flick.top }
+ source: "../../modelviews/listview/" + "content/pics/moreUp.png"
+ opacity: flick.atYBeginning ? 0 : 1
+ }
+
+ Image {
+ anchors { right: flick.right; bottom: flick.bottom }
+ source: "../../modelviews/listview/" + "content/pics/moreDown.png"
+ opacity: flick.atYEnd ? 0 : 1
+ }
+ }
+
+ // A button to close the detailed view, i.e. set the state back to default ('').
+ TextButton {
+ y: 10
+ anchors { right: background.right; rightMargin: 10 }
+ opacity: recipe.detailsOpacity
+ text: "Close"
+
+ onClicked: recipe.state = '';
+ }
+
+ states: State {
+ name: "Details"
+
+ PropertyChanges { target: background; color: "white" }
+ PropertyChanges { target: recipeImage; width: 130; height: 130 } // Make picture bigger
+ PropertyChanges { target: recipe; detailsOpacity: 1; x: 0; opacity: 1 } // Make details visible
+ PropertyChanges { target: recipe; height: root.height; width: root.height; x:0; y:0; z:100} // Fill the entire list area with the detailed view
+
+ // Move the list so that this item is at the top.
+ //PropertyChanges { target: recipe.ListView.view; explicit: true; contentY: recipe.y }
+
+ // Disallow flicking while we're in detailed view
+ //PropertyChanges { target: recipe.ListView.view; interactive: false }
+ }
+
+ transitions: Transition {
+ //The only strictly necessary particle specific lines
+ to: "Details"
+ reversible: true
+ ScriptAction{script:{
+ if(state == "Details")
+ mp.freeze(index);
+ else
+ mp.unfreeze(index);
+ }
+ }
+ // Make the state changes smooth
+ ParallelAnimation {
+ ColorAnimation { property: "color"; duration: 500 }
+ NumberAnimation { duration: 300; properties: "detailsOpacity,opacity,x,y,height,width" }
+ }
+ }
+ }
+ }
diff --git a/examples/declarative/particles/modelparticles/content/RssModel.qml b/examples/declarative/particles/modelparticles/content/RssModel.qml
new file mode 100644
index 0000000000..603a157de5
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/content/RssModel.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+XmlListModel {
+ property string tags : ""
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "")
+ query: "/feed/entry"
+ namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "content"; query: "content/string()" }
+ XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" }
+}
diff --git a/examples/declarative/particles/modelparticles/content/bubble.png b/examples/declarative/particles/modelparticles/content/bubble.png
new file mode 100644
index 0000000000..c7f479e9e3
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/content/bubble.png
Binary files differ
diff --git a/examples/declarative/particles/modelparticles/content/script.js b/examples/declarative/particles/modelparticles/content/script.js
new file mode 100644
index 0000000000..e8ef93a847
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/content/script.js
@@ -0,0 +1,27 @@
+.pragma library
+
+function getWidth(string) {
+ return (string.match(/width=\"([0-9]+)\"/))[1]
+}
+
+function getHeight(string) {
+ return (string.match(/height=\"([0-9]+)\"/))[1]
+}
+
+function getImagePath(string) {
+ var pattern = /src=\"http:\/\/(\S+)\"/
+ return (string.match(pattern))[1]
+}
+
+function calculateScale(width, height, cellSize) {
+ var widthScale = (cellSize * 1.0) / width
+ var heightScale = (cellSize * 1.0) / height
+ var scale = 0
+
+ if (widthScale <= heightScale) {
+ scale = widthScale;
+ } else if (heightScale < widthScale) {
+ scale = heightScale;
+ }
+ return scale;
+}
diff --git a/examples/declarative/particles/modelparticles/gridsplosion.qml b/examples/declarative/particles/modelparticles/gridsplosion.qml
new file mode 100644
index 0000000000..a654124587
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/gridsplosion.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "content"
+
+Item{
+ id: root
+ width: 240
+ height: 240
+ property bool inGrid: false
+ ParticleSystem{ id: sys }
+ TrailEmitter{
+ system: sys
+ id: burster;
+ emitting: false
+ particlesPerSecond: 1000
+ particleDuration: 500
+ speed: PointVector{xVariation: 400; yVariation: 400}
+ anchors.centerIn: parent
+ Timer{
+ interval: 1000
+ running: true
+ repeat: false
+ onTriggered: burster.pulse(0.1);
+ }
+ Timer{
+ interval: 2000
+ running: true
+ repeat: false
+ onTriggered: {inGrid = true;}// sys.running = false;}
+ }
+ }
+ ColoredParticle{
+ system: sys
+ image: "../trails/content/particle.png"
+ color: "black"
+ colorVariation: 0.0
+ }
+ GridView{ id: grid; cellWidth: 40; cellHeight: 40
+ model: theModel.parts.grid
+ width: 120
+ height: 120
+ }
+ ModelParticle{
+ system: sys
+ model: theModel.parts.particles
+ }
+ Friction{
+ system: sys
+ factor: 1
+ }
+ Stasis{
+ system: sys
+ targetLife: 400
+ }
+ VisualDataModel{
+ id: theModel
+ delegate: Delegate2{}
+ model: ListModel{
+ ListElement{
+ w: 40
+ h: 20
+ col: "forestgreen"
+ }
+ ListElement{
+ w: 20
+ h: 40
+ col: "salmon"
+ }
+ ListElement{
+ w: 20
+ h: 20
+ col: "lightsteelblue"
+ }
+ ListElement{
+ w: 40
+ h: 40
+ col: "goldenrod"
+ }
+ ListElement{
+ w: 40
+ h: 20
+ col: "forestgreen"
+ }
+ ListElement{
+ w: 20
+ h: 40
+ col: "salmon"
+ }
+ ListElement{
+ w: 20
+ h: 20
+ col: "lightsteelblue"
+ }
+ ListElement{
+ w: 40
+ h: 40
+ col: "goldenrod"
+ }
+ ListElement{
+ w: 0
+ h: 0
+ col: "white"//Hack because add isn't working well with old stuff
+ }
+ }
+ }
+}
diff --git a/examples/declarative/particles/modelparticles/package.qml b/examples/declarative/particles/modelparticles/package.qml
new file mode 100644
index 0000000000..402cdea84a
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/package.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "content"
+
+Rectangle {
+ color: "white"
+ width: 400
+ height: 200
+
+ ListModel {
+ id: myModel
+ ListElement { display: "One" }
+ ListElement { display: "Two" }
+ ListElement { display: "Three" }
+ ListElement { display: "Four" }
+ ListElement { display: "Five" }
+ ListElement { display: "Six" }
+ ListElement { display: "Seven" }
+ ListElement { display: "Eight" }
+ }
+ //![0]
+ VisualDataModel {
+ id: visualModel
+ delegate: Delegate {}
+ model: myModel
+ }
+
+ ListView {
+ width: 200; height:200
+ model: visualModel.parts.list
+ }
+ ModelParticle{
+ x: 200; width: 200; height:200
+ model: visualModel.parts.grid
+ system: sys
+ clip: true;
+ }
+ //![0]
+ ParticleSystem{
+ id: sys
+ anchors.fill: parent
+ }
+ TrailEmitter{
+ system: sys
+ width: 100
+ x: 50
+ speed: PointVector{ y: 40 }
+ particleDuration: 5000
+ particlesPerSecond: 1.6
+ }
+}
diff --git a/examples/declarative/particles/modelparticles/stream.qml b/examples/declarative/particles/modelparticles/stream.qml
new file mode 100644
index 0000000000..b67d6c42af
--- /dev/null
+++ b/examples/declarative/particles/modelparticles/stream.qml
@@ -0,0 +1,280 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "content/script.js" as Script
+import "content"
+
+Item{
+ id: root
+ width: 640
+ height: 480
+ Rectangle{
+ anchors.fill: parent
+ color: "black"
+ z: -1
+ }
+ Item{
+ id: loading
+ Behavior on opacity{NumberAnimation{}}
+ anchors.fill: parent
+ Text{
+ anchors.centerIn: parent
+ text: "Loading"
+ color: "white"
+ }
+ }
+ ParticleSystem{
+ id: sys;
+ running: true
+ overwrite: false
+ startTime: 12000//Doesn't actually work with the loading time though...
+ }
+ TrailEmitter{
+ id: emitter
+ system: sys
+ height: parent.height - 132/2
+ x: -132/2
+ y: 132/2
+ speed: PointVector{ x: 32; xVariation: 8 }
+ particlesPerSecond: 0.5
+ particleDuration: 120000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
+ particle: "photos"
+ }
+ Kill{
+ system: sys
+ x: parent.width + 132/2
+ height: parent.height
+ width: 1000
+ }
+ ColoredParticle{
+ system: sys
+ particles: ["fireworks"]
+ image: "../trails/content/star.png"
+ color: "lightsteelblue"
+ alpha: 0
+ colorVariation: 0
+ z: 1000
+ }
+ ModelParticle{
+ id: mp
+ z: 0
+ system: sys
+ fade: false
+ particles: ["photos"]
+ }
+ Component{
+ id: alertDelegate
+ Rectangle{
+ width: 132
+ height: 132
+ NumberAnimation on scale{
+ running: true
+ loops: 1
+ from: 0.2
+ to: 1
+ }
+ Image{
+ source: "../asteroid/content/rocket.png"
+ anchors.centerIn: parent
+ }
+ Text{
+ anchors.bottom: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: "A new ship has arrived!"
+ }
+ }
+ }
+ property Item alertItem;
+ function alert(){
+ resetter.active = false
+ force.active = true;
+ alertItem = alertDelegate.createObject(root);
+ alertItem.x = root.width/2 - alertItem.width/2
+ alertItem.y = root.height/2 - alertItem.height/2
+ spawnFireworks.pulse(0.2);
+ stopAlert.start();
+ }
+ focus: true
+ Keys.onSpacePressed: alert();
+ Timer{
+ id: stopAlert
+ running: false
+ repeat: false
+ interval: 800
+ onTriggered: {
+ force.active = false
+ resetter.active = true;
+ mp.take(alertItem, true);
+ centerEmitter.burst(1);
+ }
+ }
+ Attractor{
+ id: force
+ system: sys
+ x: root.width/2
+ y: root.height/2
+ strength: -30000
+ active: false
+ anchors.centerIn: parent
+ width: parent.width/2
+ height: parent.height/2
+ particles:["photos"]
+ }
+ Reset{
+ id: resetter
+ system: sys
+ particles:["photos"]
+ }
+ TrailEmitter{
+ id: centerEmitter
+ speed: PointVector{ x: 32; xVariation: 8;}
+ particlesPerSecond: 0.5
+ particleDuration: 12000 //TODO: A -1 or something which does 'infinite'? (but need disable fade first)
+ maxParticles: 20
+ particle: "photos"
+ system: sys
+ anchors.centerIn: parent
+ emitting: false
+
+ //TODO: Zoom in effect
+ }
+ TrailEmitter{
+ id: spawnFireworks
+ particle: "fireworks"
+ system: sys
+ maxParticles: 400
+ particlesPerSecond: 400
+ particleDuration: 2800
+ x: parent.width/2
+ y: parent.height/2 - 64
+ width: 8
+ height: 8
+ emitting: false
+ particleSize: 32
+ particleEndSize: 8
+ speed: AngleVector{ magnitude: 160; magnitudeVariation: 120; angleVariation: 90; angle: 270 }
+ acceleration: PointVector{ y: 160 }
+ }
+ Item{ x: -1000; y: -1000 //offscreen
+ Repeater{//Load them here, add to system on completed
+ model: theModel
+ delegate: theDelegate
+ }
+ }
+ RssModel{id: theModel; tags:"particle,particles"}
+ Component {
+ id: theDelegate
+ Rectangle {
+ id: container
+ border.width: 2
+ property real myRand: Math.random();//'depth'
+ z: Math.floor(myRand * 100)
+ scale: (myRand + 1.0)/2;
+ //TODO: Darken based on 'depth'
+ width: 132
+ height: 132
+ //ModelParticle.onAttached: console.log("I'm in" + x + "," + y + ":" + opacity);
+ ModelParticle.onDetached: mp.take(container);//respawns
+ function manage()
+ {
+ if(state == "selected"){
+ // console.log("Taking " + index);
+ mp.freeze(container);
+ }else{
+ // console.log("Returning " +index);
+ mp.unfreeze(container);
+ }
+ }
+ Image{
+ id: img
+ anchors.centerIn: parent
+ smooth: true; source: "http://" + Script.getImagePath(content); cache: true
+ fillMode: Image.PreserveAspectFit;
+ width: parent.width-4; height: parent.height-4
+ onStatusChanged: if(img.status == Image.Ready){
+ loading.opacity = 0;
+ mp.take(container);
+ }
+ }
+ Text{
+ anchors.bottom: parent.bottom
+ width: parent.width
+ horizontalAlignment: Text.AlignHCenter
+ elide: Text.ElideRight
+ text: title
+ color: "black"
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked: container.state == "selected" ? container.state = "" : container.state = "selected"
+ }
+ states: State{
+ name: "selected"
+ ParentChange{
+ target: container
+ parent: root
+ x: 0
+ y: 0
+ }
+ PropertyChanges{
+ target: container
+ width: root.width
+ height: root.height
+ z: 101
+ opacity: 1
+ rotation: 0
+ }
+ }
+ transitions: Transition{
+ to: "selected"
+ reversible: true
+ SequentialAnimation{
+ ScriptAction{script: container.manage();}
+ ParallelAnimation{
+ ParentAnimation{NumberAnimation{ properties: "x,y" }}//Doesn't work, particles takes control of x,y instantly
+ NumberAnimation{ properties: "width, height, z, rotation" }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/examples/declarative/particles/snow/content/flake-01.png b/examples/declarative/particles/snow/content/flake-01.png
new file mode 100644
index 0000000000..490887a82f
--- /dev/null
+++ b/examples/declarative/particles/snow/content/flake-01.png
Binary files differ
diff --git a/examples/declarative/particles/snow/snow.qml b/examples/declarative/particles/snow/snow.qml
new file mode 100644
index 0000000000..25d2e1468b
--- /dev/null
+++ b/examples/declarative/particles/snow/snow.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ width: 360
+ height: 540
+ ParticleSystem { id: particles }
+ SpriteParticle {
+ system: particles
+ Sprite{
+ name: "snow"
+ source: "content/flake-01.png"
+ frames: 51
+ duration: 40
+ }
+ }
+ Wander {
+ system: particles
+ anchors.fill: parent
+ xVariance: 40;
+ pace: 40;
+ }
+ TrailEmitter {
+ system: particles
+ particlesPerSecond: 20
+ particleDuration: 7000
+ emitting: true
+ speed: PointVector{ y:80; yVariation: 40; }
+ acceleration: PointVector{ y: 4 }
+ particleSize: 20
+ particleSizeVariation: 10
+ width: parent.width
+ height: 100
+ }
+}
diff --git a/examples/declarative/particles/snow/snow2.qml b/examples/declarative/particles/snow/snow2.qml
new file mode 100644
index 0000000000..c016ba2934
--- /dev/null
+++ b/examples/declarative/particles/snow/snow2.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ width: 360
+ height: 540
+ ParticleSystem{ id: particles }
+ SpriteParticle{
+ system: particles
+ Sprite{
+ name: "snow"
+ source: "content/flake-01.png"
+ frames: 51
+ duration: 40
+ }
+ }
+ Drift{
+ system: particles
+ anchors.fill: parent
+ xDrift: 400;
+ }
+ TrailEmitter{
+ system: particles
+ particlesPerSecond: 20
+ particleDuration: 7000
+ emitting: true
+ speed: PointVector{ y:80; yVariation: 40; }
+ acceleration: PointVector{ y: 4 }
+ particleSize: 20
+ particleSizeVariation: 10
+ width: parent.width
+ height: 100
+ }
+}
diff --git a/examples/declarative/particles/snow/snow3.qml b/examples/declarative/particles/snow/snow3.qml
new file mode 100644
index 0000000000..080bc4d1af
--- /dev/null
+++ b/examples/declarative/particles/snow/snow3.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ width: 360
+ height: 540
+ id: root
+ ParticleSystem{ id: particles }
+ SpriteParticle{
+ system: particles
+ sprites: Sprite{
+ name: "snow"
+ source: "content/flake-01.png"
+ frames: 51
+ duration: 40
+ }
+ }
+ Drift{
+ system: particles
+ anchors.fill: parent
+ xDrift: 200
+ }
+ SpeedLimit{
+ system: particles
+ anchors.fill: parent
+ speedLimit: 100
+ }
+ TrailEmitter{
+ system: particles
+ particlesPerSecond: 20
+ particleDuration: 7000
+ emitting: true
+ speed: PointVector{ y:80; yVariation: 40; }
+ acceleration: PointVector{ y: 4 }
+ particleSize: 20
+ particleSizeVariation: 10
+ width: parent.width
+ height: 40
+ }
+}
diff --git a/examples/declarative/particles/spaceexplorer/content/helpers.js b/examples/declarative/particles/spaceexplorer/content/helpers.js
new file mode 100644
index 0000000000..c38c4c0eed
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/helpers.js
@@ -0,0 +1,8 @@
+function intersects(item, x, y, e){
+ return x+e >= item.x && x-e <= item.x + item.width && y+e >= item.y && y-e <= item.y + item.height;
+}
+
+function direction(x1, y1, x2, y2){
+ return Math.atan2(y2-y1, x2-x1) * (180/Math.PI);
+}
+
diff --git a/examples/declarative/particles/spaceexplorer/content/particle4.png b/examples/declarative/particles/spaceexplorer/content/particle4.png
new file mode 100644
index 0000000000..bc95b703c1
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/particle4.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/powerupScore.png b/examples/declarative/particles/spaceexplorer/content/powerupScore.png
new file mode 100644
index 0000000000..e8c368aea7
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/powerupScore.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/powerupScore_gone.png b/examples/declarative/particles/spaceexplorer/content/powerupScore_gone.png
new file mode 100644
index 0000000000..4076327a1a
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/powerupScore_gone.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/powerupScore_got.png b/examples/declarative/particles/spaceexplorer/content/powerupScore_got.png
new file mode 100644
index 0000000000..4297245d49
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/powerupScore_got.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/rocket.png b/examples/declarative/particles/spaceexplorer/content/rocket.png
new file mode 100644
index 0000000000..a171610b03
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/rocket.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/rocket2.png b/examples/declarative/particles/spaceexplorer/content/rocket2.png
new file mode 100644
index 0000000000..7110f8fdc6
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/rocket2.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/rocketEye.png b/examples/declarative/particles/spaceexplorer/content/rocketEye.png
new file mode 100644
index 0000000000..20005937d2
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/rocketEye.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/content/star.png b/examples/declarative/particles/spaceexplorer/content/star.png
new file mode 100644
index 0000000000..0d592cfa87
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/star.png
Binary files differ
diff --git a/examples/declarative/particles/spaceexplorer/spaceexplorer.qml b/examples/declarative/particles/spaceexplorer/spaceexplorer.qml
new file mode 100644
index 0000000000..091ca0a8b5
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/spaceexplorer.qml
@@ -0,0 +1,412 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "content/helpers.js" as Helpers
+
+Rectangle{
+ id: root
+ width: 360
+ height: 540
+ color: "black"
+ Image{
+ anchors.centerIn: parent
+ source: "../asteroid/content/finalfrontier.png"
+ }
+ property bool spacePressed: false
+ property int holeSize: 4
+ focus: true
+ Keys.onPressed: {
+ if (event.key == Qt.Key_Space) {
+ spacePressed = true;
+ event.accepted = true;
+ }
+ }
+ Keys.onReleased: {
+ if (event.key == Qt.Key_Space) {
+ spacePressed = false;
+ event.accepted = true;
+ }
+ }
+
+ function fakeMove(){
+ fakeMoving = rocket.x < 80 || rocket.x+rocket.width-root.width > -80 || rocket.y < 80 || rocket.y+rocket.height-root.height > -80;
+ if(fakeMoving)
+ fakeMovementDir = Helpers.direction(root.width/2, root.height/2, rocket.x, rocket.y) + 180;
+ }
+ property bool fakeMoving: false
+ property real fakeMovementDir: 0
+
+ TrailEmitter{
+ particle: "stars2"
+ system: background
+ particlesPerSecond: 60
+ particleDuration: 4000
+ emitting: true
+ particleSize: 10
+ particleSizeVariation: 10
+ anchors.fill: parent
+ }
+ ParticleSystem{ id: background }
+ ColoredParticle{
+ particles: ["stars2"]
+ system: background
+ anchors.fill: parent
+ image: "content/star.png"
+ color: "white"
+ colorVariation: 0.1
+ }
+ Gravity{
+ system: background
+ anchors.fill: parent
+ acceleration: fakeMoving?10:0
+ angle: fakeMovementDir
+ }
+ Text{
+ color: "white"
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ text:"Drag the ship, but don't hit a black hole!"
+ font.pixelSize: 10
+ }
+ Text{
+ color: "white"
+ font.pixelSize: 36
+ anchors.centerIn: parent
+ text: "GAME OVER"
+ opacity: gameOver ? 1 : 0
+ Behavior on opacity{NumberAnimation{}}
+ }
+ Text{
+ color: "white"
+ font.pixelSize: 18
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ anchors.margins: 8
+ text: "Score: " + score
+ }
+ Image{
+ source: "content/star.png"
+ width: 40
+ height: 40
+ anchors.right: parent.right
+ anchors.top: parent.top
+ MouseArea{
+ anchors.fill: parent
+ anchors.margins: -20
+ onClicked: shoot = !shoot
+ }
+ }
+ property int score: 0
+ property bool gameOver: false
+ property bool shoot: true
+ property int maxLives: 3
+ property int lives: maxLives
+ property bool alive: !Helpers.intersects(rocket, gs1.x, gs1.y, holeSize) && !Helpers.intersects(rocket, gs2.x, gs2.y, holeSize) && !Helpers.intersects(rocket, gs3.x, gs3.y, holeSize) && !Helpers.intersects(rocket, gs4.x, gs4.y, holeSize);
+ onAliveChanged: if(!alive){
+ lives -= 1;
+ if(lives == -1){
+ console.log("game over");
+ gameOver = true;
+ }
+ }
+ Row{
+ Repeater{
+ model: maxLives
+ delegate: Image{
+ opacity: index < lives ? 1 : 0
+ Behavior on opacity{NumberAnimation{}}
+ source: "content/rocket.png"
+ }
+ }
+ }
+
+ property real courseDur: 10000
+ property real vorteX: width/4
+ property real vorteY: height/4
+ Behavior on vorteX{NumberAnimation{duration: courseDur}}
+ Behavior on vorteY{NumberAnimation{duration: courseDur}}
+ property real vorteX2: width/4
+ property real vorteY2: 3*height/4
+ Behavior on vorteX2{NumberAnimation{duration: courseDur}}
+ Behavior on vorteY2{NumberAnimation{duration: courseDur}}
+ property real vorteX3: 3*width/4
+ property real vorteY3: height/4
+ Behavior on vorteX3{NumberAnimation{duration: courseDur}}
+ Behavior on vorteY3{NumberAnimation{duration: courseDur}}
+ property real vorteX4: 3*width/4
+ property real vorteY4: 3*height/4
+ Behavior on vorteX4{NumberAnimation{duration: courseDur}}
+ Behavior on vorteY4{NumberAnimation{duration: courseDur}}
+ Timer{
+ id: vorTimer
+ interval: courseDur
+ running: true
+ repeat: true
+ triggeredOnStart: true
+ onTriggered: {
+ vorteX = Math.random() * width * 2 - width * 0.5;
+ vorteY = Math.random() * height * 2 - height * 0.5;
+ vorteX2 = Math.random() * width * 2 - width * 0.5;
+ vorteY2 = Math.random() * height * 2 - height * 0.5;
+ vorteX3 = Math.random() * width * 2 - width * 0.5;
+ vorteY3 = Math.random() * height * 2 - height * 0.5;
+ vorteX4 = Math.random() * width * 2 - width * 0.5;
+ vorteY4 = Math.random() * height * 2 - height * 0.5;
+ }
+ }
+
+
+
+ ParticleSystem{ id: foreground }
+ ColoredParticle{
+ particles: ["stars"]
+ anchors.fill: parent
+ system: foreground
+ image: "content/star.png"
+ color: "white"
+ colorVariation: 0.1
+ }
+ ColoredParticle{
+ particles: ["shot"]
+ anchors.fill: parent
+ system: foreground
+ image: "content/star.png"
+
+ color: "orange"
+ colorVariation: 0.3
+ }
+ ColoredParticle{
+ id: engine
+ particles: ["engine"]
+ anchors.fill: parent
+ system: foreground
+ image: "content/particle4.png"
+
+ color: "orange"
+ SequentialAnimation on color {
+ loops: Animation.Infinite
+ ColorAnimation {
+ from: "red"
+ to: "cyan"
+ duration: 1000
+ }
+ ColorAnimation {
+ from: "cyan"
+ to: "red"
+ duration: 1000
+ }
+ }
+
+ colorVariation: 0.2
+ }
+ SpriteParticle{
+ particles: ["powerups"]
+ anchors.fill: parent
+ system: foreground
+ Sprite{
+ name: "norm"
+ source: "content/powerupScore.png"
+ frames: 35
+ duration: 40
+ to: {"norm":1, "got":0}
+ }
+ Sprite{
+ name: "got"
+ source: "content/powerupScore_got.png"
+ frames: 22
+ duration: 40
+ to: {"null":1}
+ }
+ Sprite{
+ name: "null"
+ source: "content/powerupScore_gone.png"
+ frames: 1
+ duration: 1000
+ }
+ }
+ SpriteGoal{
+ x: rocket.x - 30
+ y: rocket.y - 30
+ width: 60
+ height: 60
+ goalState: "got"
+ jump: true
+ onAffected: if(!gameOver) score += 1000
+ system: foreground
+ }
+ GravitationalSingularity{
+ id: gs1; x: vorteX; y: vorteY; strength: 800000;
+ system: foreground
+ }
+ Kill{
+ x: gs1.x - holeSize;
+ y: gs1.y - holeSize;
+ width: holeSize * 2
+ height: holeSize * 2
+ system: foreground
+ }
+
+ GravitationalSingularity{
+ id: gs2; x: vorteX2; y: vorteY2; strength: 800000;
+ system: foreground
+ }
+ Kill{
+ x: gs2.x - holeSize;
+ y: gs2.y - holeSize;
+ width: holeSize * 2
+ height: holeSize * 2
+ system: foreground
+ }
+
+ GravitationalSingularity{
+ id: gs3; x: vorteX3; y: vorteY3; strength: 800000;
+ system: foreground
+ }
+ Kill{
+ x: gs3.x - holeSize;
+ y: gs3.y - holeSize;
+ width: holeSize * 2
+ height: holeSize * 2
+ system: foreground
+ }
+ GravitationalSingularity{
+ id: gs4; x: vorteX4; y: vorteY4; strength: 800000;
+ system: foreground
+ }
+ Kill{
+ x: gs4.x - holeSize;
+ y: gs4.y - holeSize;
+ width: holeSize * 2
+ height: holeSize * 2
+ system: foreground
+ }
+ TrailEmitter{
+ particle: "powerups"
+ system: foreground
+ particlesPerSecond: 1
+ particleDuration: 6000
+ emitting: !gameOver
+ particleSize: 60
+ particleSizeVariation: 10
+ anchors.fill: parent
+ }
+ TrailEmitter{
+ particle: "stars"
+ system: foreground
+ particlesPerSecond: 40
+ particleDuration: 4000
+ emitting: !gameOver
+ particleSize: 30
+ particleSizeVariation: 10
+ anchors.fill: parent
+ }
+ SpriteImage{
+ id: rocket
+ //Sprites or children for default?
+ Sprite{
+ name: "normal"
+ source: "content/rocket2.png"
+ frames: 1
+ duration: 1000
+ to: {"normal": 0.9, "winking" : 0.1}
+ }
+ Sprite{
+ name: "winking"
+ source: "content/rocketEye.png"
+ frames: 10
+ duration: 40
+ to: {"normal" : 1}
+ }
+ x: root.width/2
+ y: root.height/2
+ property int lx: 0
+ property int ly: 0
+ property int lastX: 0
+ property int lastY: 0
+ width: 45
+ height: 22
+ onXChanged:{ lastX = lx; lx = x; fakeMove()}
+ onYChanged:{ lastY = ly; ly = y; fakeMove()}
+ rotation: Helpers.direction(lastX, lastY, x, y)
+ data:[
+ MouseArea{
+ id: ma
+ anchors.fill: parent;
+ drag.axis: Drag.XandYAxis
+ drag.target: rocket
+ },
+ TrailEmitter{
+ system: foreground
+ particle: "engine"
+ particlesPerSecond: 100
+ particleDuration: 1000
+ emitting: !gameOver
+ particleSize: 10
+ particleEndSize: 4
+ particleSizeVariation: 4
+ speed: PointVector{
+ x: -128 * Math.cos(rocket.rotation * (Math.PI / 180))
+ y: -128 * Math.sin(rocket.rotation * (Math.PI / 180))
+ }
+ anchors.verticalCenter: parent.verticalCenter
+ height: 4
+ width: 4
+
+ },
+ TrailEmitter{
+ system: foreground
+ particle: "shot"
+ particlesPerSecond: 16
+ particleDuration: 1600
+ emitting: !gameOver && shoot
+ particleSize: 40
+ speed: PointVector{
+ x: 256 * Math.cos(rocket.rotation * (Math.PI / 180))
+ y: 256 * Math.sin(rocket.rotation * (Math.PI / 180))
+ }
+ x: parent.width - 4
+ y: parent.height/2
+ }
+ ]
+ }
+}
+
diff --git a/examples/declarative/particles/trails/content/PetsModel.qml b/examples/declarative/particles/trails/content/PetsModel.qml
new file mode 100644
index 0000000000..d7375a73af
--- /dev/null
+++ b/examples/declarative/particles/trails/content/PetsModel.qml
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+ListModel {
+ ListElement {
+ name: "Polly"
+ type: "Parrot"
+ age: 12
+ size: "Small"
+ }
+ ListElement {
+ name: "Penny"
+ type: "Turtle"
+ age: 4
+ size: "Small"
+ }
+ ListElement {
+ name: "Warren"
+ type: "Rabbit"
+ age: 2
+ size: "Small"
+ }
+ ListElement {
+ name: "Spot"
+ type: "Dog"
+ age: 9
+ size: "Medium"
+ }
+ ListElement {
+ name: "Schrödinger"
+ type: "Cat"
+ age: 2
+ size: "Medium"
+ }
+ ListElement {
+ name: "Joey"
+ type: "Kangaroo"
+ age: 1
+ size: "Medium"
+ }
+ ListElement {
+ name: "Kimba"
+ type: "Bunny"
+ age: 65
+ size: "Large"
+ }
+ ListElement {
+ name: "Rover"
+ type: "Dog"
+ age: 5
+ size: "Large"
+ }
+ ListElement {
+ name: "Tiny"
+ type: "Elephant"
+ age: 15
+ size: "Large"
+ }
+}
diff --git a/examples/declarative/particles/trails/content/candle.png b/examples/declarative/particles/trails/content/candle.png
new file mode 100644
index 0000000000..8fa3193719
--- /dev/null
+++ b/examples/declarative/particles/trails/content/candle.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/colortable.png b/examples/declarative/particles/trails/content/colortable.png
new file mode 100644
index 0000000000..a62ceeb4a0
--- /dev/null
+++ b/examples/declarative/particles/trails/content/colortable.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/particle.png b/examples/declarative/particles/trails/content/particle.png
new file mode 100644
index 0000000000..5c83896d22
--- /dev/null
+++ b/examples/declarative/particles/trails/content/particle.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/particle2.png b/examples/declarative/particles/trails/content/particle2.png
new file mode 100644
index 0000000000..36349c6c6e
--- /dev/null
+++ b/examples/declarative/particles/trails/content/particle2.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/particle3.png b/examples/declarative/particles/trails/content/particle3.png
new file mode 100644
index 0000000000..905d8f37b8
--- /dev/null
+++ b/examples/declarative/particles/trails/content/particle3.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/particleA.png b/examples/declarative/particles/trails/content/particleA.png
new file mode 100644
index 0000000000..c63acdee1f
--- /dev/null
+++ b/examples/declarative/particles/trails/content/particleA.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/portal_bg.png b/examples/declarative/particles/trails/content/portal_bg.png
new file mode 100644
index 0000000000..3c59eeabb9
--- /dev/null
+++ b/examples/declarative/particles/trails/content/portal_bg.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/sparkleSize.png b/examples/declarative/particles/trails/content/sparkleSize.png
new file mode 100644
index 0000000000..752056541b
--- /dev/null
+++ b/examples/declarative/particles/trails/content/sparkleSize.png
Binary files differ
diff --git a/examples/declarative/particles/trails/content/star.png b/examples/declarative/particles/trails/content/star.png
new file mode 100644
index 0000000000..0d592cfa87
--- /dev/null
+++ b/examples/declarative/particles/trails/content/star.png
Binary files differ
diff --git a/examples/declarative/particles/trails/dynamicemitters.qml b/examples/declarative/particles/trails/dynamicemitters.qml
new file mode 100644
index 0000000000..8ea0272d94
--- /dev/null
+++ b/examples/declarative/particles/trails/dynamicemitters.qml
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ id: root
+ color: "black"
+ width: 640
+ height: 480
+ ParticleSystem{
+ id: sys
+ }
+ ColoredParticle{
+ system: sys
+ image: "content/particle.png"
+ color: "white"
+ colorVariation: 1.0
+ alpha: 0.1
+ }
+ Component{
+ id: emitterComp
+ TrailEmitter{
+ id: container
+ TrailEmitter{
+ id: emitMore
+ system: sys
+ emitting: true
+ particlesPerSecond: 128
+ particleDuration: 600
+ particleSize: 16
+ particleEndSize: 8
+ speed: AngleVector{angleVariation:360; magnitude: 60}
+ }
+
+ property int life: 2600
+ property real targetX: 0
+ property real targetY: 0
+ function go(){
+ xAnim.start();
+ yAnim.start();
+ container.emitting = true
+ }
+ system: sys
+ emitting: true
+ particlesPerSecond: 64
+ particleDuration: 600
+ particleSize: 24
+ particleEndSize: 8
+ NumberAnimation on x{
+ id: xAnim;
+ to: targetX
+ duration: life
+ running: false
+ }
+ NumberAnimation on y{
+ id: yAnim;
+ to: targetY
+ duration: life
+ running: false
+ }
+ Timer{
+ interval: life
+ running: true
+ onTriggered: container.destroy();
+ }
+ }
+ }
+ MouseArea{
+ anchors.fill: parent
+ onClicked:{
+ for(var i=0; i<16; i++){
+ var obj = emitterComp.createObject(root);
+ obj.x = mouse.x
+ obj.y = mouse.y
+ obj.targetX = Math.random() * 640
+ obj.targetY = Math.random() * 480
+ obj.life = Math.round(Math.random() * 2400) + 200
+ obj.go();
+ }
+ }
+ }
+}
diff --git a/examples/declarative/particles/trails/fireballs.qml b/examples/declarative/particles/trails/fireballs.qml
new file mode 100644
index 0000000000..116a2334dc
--- /dev/null
+++ b/examples/declarative/particles/trails/fireballs.qml
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle {
+ id: root
+ width: 360
+ height: 540
+ color: "black"
+
+ ParticleSystem{
+ id: particles
+ }
+
+ /*
+ ColoredParticle{
+ id: fireball
+ anchors.fill: parent
+ particles: ["E"]
+ system: particles
+ image: "content/particleA.png"
+ colorVariation: 0.2
+ color: "#00ff400f"
+ }
+ */
+ ColoredParticle{
+ id: smoke
+ system: particles
+ anchors.fill: parent
+ particles: ["A", "B"]
+ image: "content/particle.png"
+ colorVariation: 0
+ color: "#00111111"
+ }
+ ColoredParticle{
+ id: flame
+ anchors.fill: parent
+ system: particles
+ particles: ["C", "D"]
+ image: "content/particle.png"
+ colorVariation: 0.1
+ color: "#00ff400f"
+ }
+ TrailEmitter{
+ id: fire
+ system: particles
+ particle: "C"
+
+ y: parent.height
+ width: parent.width
+
+ particlesPerSecond: 350
+ particleDuration: 3500
+
+ acceleration: PointVector{ y: -17; xVariation: 3 }
+ speed: PointVector{xVariation: 3}
+
+ particleSize: 24
+ particleSizeVariation: 8
+ particleEndSize: 4
+ }
+ FollowEmitter{
+ id: fireSmoke
+ particle: "B"
+ system: particles
+ follow: "C"
+ width: root.width
+ height: root.height - 68
+
+ particlesPerParticlePerSecond: 1
+ particleDuration: 2000
+
+ speed: PointVector{y:-17*6; yVariation: -17; xVariation: 3}
+ acceleration: PointVector{xVariation: 3}
+
+ particleSize: 36
+ particleSizeVariation: 8
+ particleEndSize: 16
+ }
+ FollowEmitter{
+ id: fireballFlame
+ anchors.fill: parent
+ system: particles
+ particle: "D"
+ follow: "E"
+
+ particlesPerParticlePerSecond: 120
+ particleDuration: 180
+ emissionWidth: 8
+ emissionHeight: 8
+
+ particleSize: 16
+ particleSizeVariation: 4
+ particleEndSize: 4
+ }
+
+ FollowEmitter{
+ id: fireballSmoke
+ anchors.fill: parent
+ system: particles
+ particle: "A"
+ follow: "E"
+
+ particlesPerParticlePerSecond: 128
+ particleDuration: 2400
+ emissionWidth: 16
+ emissionHeight: 16
+
+ speed: PointVector{yVariation: 16; xVariation: 16}
+ acceleration: PointVector{y: -16}
+
+ particleSize: 24
+ particleSizeVariation: 8
+ particleEndSize: 8
+ }
+ TrailEmitter{
+ id: balls
+ system: particles
+ particle: "E"
+
+ y: parent.height
+ width: parent.width
+
+ particlesPerSecond: 2
+ particleDuration: 7000
+
+ speed: PointVector{y:-17*4*2; xVariation: 6*6}
+ acceleration: PointVector{y: 17*2; xVariation: 6*6}
+
+ particleSize: 12
+ particleSizeVariation: 4
+ }
+
+}
+
diff --git a/examples/declarative/particles/trails/layered.qml b/examples/declarative/particles/trails/layered.qml
new file mode 100644
index 0000000000..38eb8e67dc
--- /dev/null
+++ b/examples/declarative/particles/trails/layered.qml
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ id: root
+ width: 360
+ height: 600
+ color: "darkblue"
+ property bool cloneMode: false
+ MouseArea{
+ anchors.fill: parent
+ onClicked: cloneMode = !cloneMode;
+ }
+ ParticleSystem{
+ id: sys
+ startTime: 4000
+ }
+ TrailEmitter{
+ system: sys
+ y:root.height + 20
+ width: root.width
+ particlesPerSecond: 200
+ particleDuration: 4000
+ speed: PointVector{ y: -120; }
+ }
+ SpriteParticle{
+ system: sys
+ visible: !cloneMode
+ Sprite{
+ source: "content/particle2.png"
+ }
+ }
+ SpriteParticle{
+ system: sys
+ visible: cloneMode
+ z: 0
+ Sprite{
+ source: "content/particle3.png"
+ }
+ }
+ SpriteParticle{
+ system: sys
+ clip: true
+ visible: cloneMode
+ y: 120
+ height: 240
+ width: root.width
+ z: 1
+ Sprite{
+ source: "content/particle.png"
+ }
+ }
+}
diff --git a/examples/declarative/particles/trails/list.qml b/examples/declarative/particles/trails/list.qml
new file mode 100644
index 0000000000..2ab579f126
--- /dev/null
+++ b/examples/declarative/particles/trails/list.qml
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// This example shows how to create your own highlight delegate for a ListView
+// that uses a SpringAnimation to provide custom movement when the
+// highlight bar is moved between items. + Particles.
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+import "content"
+
+Rectangle {
+ width: 200; height: 300
+ color: "black"
+ ParticleSystem{ id: particles }
+ ColoredParticle{
+ anchors.fill: parent
+ system: particles
+ z: 10
+ image: "content/star.png"
+ color: "white"
+ colorVariation: 0.0
+ }
+
+ // Define a delegate component. A component will be
+ // instantiated for each visible item in the list.
+ Component {
+ id: petDelegate
+ Item {
+ id: wrapper
+ width: 200; height: 55
+ Column {
+ Text { text: 'Name: ' + name; color: "white" }
+ Text { text: 'Type: ' + type; color: "white" }
+ Text { text: 'Age: ' + age; color: "white" }
+ }
+ // indent the item if it is the current item
+ states: State {
+ name: "Current"
+ when: wrapper.ListView.isCurrentItem
+ PropertyChanges { target: wrapper; x: 20 }
+ }
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 200 }
+ }
+ }
+ }
+
+ // Define a highlight with customised movement between items.
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: 200; height: 50
+ color: "#333366"
+ y: listView.currentItem.y;
+ //Behavior on y { SpringAnimation { spring: 2; damping: 0.1 } }
+ Behavior on y { NumberAnimation {id: anim} }
+ TrailEmitter{
+ anchors.fill: parent
+ system: particles;
+ emitting: anim.running
+ particlesPerSecond: 600
+ particleDuration: 600
+ particleSize: 16
+ particleEndSize: 8
+ }
+ }
+ }
+
+ ListView {
+ id: listView
+ width: 200; height: parent.height
+
+ model: PetsModel {}
+ delegate: petDelegate
+ focus: true
+
+ // Set the highlight delegate. Note we must also set highlightFollowsCurrentItem
+ // to false so the highlight delegate can control how the highlight is moved.
+ highlight: highlightBar
+ highlightFollowsCurrentItem: false
+ }
+}
diff --git a/examples/declarative/particles/trails/overburst.qml b/examples/declarative/particles/trails/overburst.qml
new file mode 100644
index 0000000000..6ca15972a4
--- /dev/null
+++ b/examples/declarative/particles/trails/overburst.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ color: "black"
+ width: 360
+ height: 540
+ ParticleSystem{ id: sys }
+ ColoredParticle{
+ system: sys
+ id: cp
+ image: "content/particle.png"
+ colorVariation: 0.4
+ color: "#000000FF"
+ }
+ TrailEmitter{
+ //burst on click
+ id: bursty
+ system: sys
+ emitting: ma.pressed
+ x: ma.mouseX
+ y: ma.mouseY
+ particlesPerSecond: 16000
+ particleDuration: 1000
+ maxParticles: 4000
+ acceleration: AngleVector{angleVariation: 360; magnitude: 360; }
+ particleSize: 8
+ particleEndSize: 16
+ particleSizeVariation: 4
+ }
+ MouseArea{
+ anchors.fill: parent
+ id: ma
+ }
+ MouseArea{
+ width: 100
+ height: 100
+ onClicked: sys.overwrite = !sys.overwrite
+ id: ma2
+ Rectangle{
+ anchors.fill: parent
+ color: "lightsteelblue"
+ }
+ }
+}
diff --git a/examples/declarative/particles/trails/portal.qml b/examples/declarative/particles/trails/portal.qml
new file mode 100644
index 0000000000..dba2e59513
--- /dev/null
+++ b/examples/declarative/particles/trails/portal.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ id: root
+ width: 360
+ height: 540
+ color: "black"
+ Image{
+ anchors.fill: parent
+ source: "content/portal_bg.png"
+ }
+ ParticleSystem{
+ id: particles
+ startTime: 2000
+ }
+ ColoredParticle{
+ particles: ["center","edge"]
+ anchors.fill: parent
+ system: particles
+ image: "content/particle.png"
+ colorVariation: 0.1
+ color: "#009999FF"
+ }
+ TrailEmitter{
+ anchors.fill: parent
+ particle: "center"
+ system: particles
+ particlesPerSecond: 200
+ particleDuration: 2000
+ emitting: true
+ particleSize: 20
+ particleSizeVariation: 2
+ particleEndSize: 0
+ shape: Ellipse{fill: false}
+ speed: DirectedVector{
+ targetX: root.width/2
+ targetY: root.height/2
+ proportionalMagnitude: true
+ magnitude: 0.5
+ }
+ }
+ TrailEmitter{
+ anchors.fill: parent
+ particle: "edge"
+ system: particles
+ particlesPerSecond: 4000
+ particleDuration: 2000
+ emitting: true
+ particleSize: 20
+ particleSizeVariation: 2
+ particleEndSize: 0
+ shape: Ellipse{fill: false}
+ speed: DirectedVector{
+ targetX: root.width/2
+ targetY: root.height/2
+ proportionalMagnitude: true
+ magnitude: 0.1
+ magnitudeVariation: 0.1
+ }
+ acceleration: DirectedVector{
+ targetX: root.width/2
+ targetY: root.height/2
+ targetVariation: 200
+ proportionalMagnitude: true
+ magnitude: 0.1
+ magnitudeVariation: 0.1
+ }
+ }
+}
diff --git a/examples/declarative/particles/trails/rainbow.qml b/examples/declarative/particles/trails/rainbow.qml
new file mode 100644
index 0000000000..6c64929668
--- /dev/null
+++ b/examples/declarative/particles/trails/rainbow.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import Qt.labs.particles 2.0
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+ width: 360
+ height: 540
+ color: "black"
+
+ ParticleSystem{ id: particles }
+ ColoredParticle{
+ system: particles
+ colorVariation: 0.5
+ alpha: 0
+
+ image: "content/particle.png"
+ colorTable: "content/colortable.png"
+ sizeTable: "content/colortable.png"
+ }
+ TrailEmitter{
+ system: particles
+ particlesPerSecond: 500
+ particleDuration: 2000
+
+ y: root.height / 2 + Math.sin(t * 2) * root.height * 0.3
+ x: root.width / 2 + Math.cos(t) * root.width * 0.3
+ property real t;
+
+ NumberAnimation on t {
+ from: 0; to: Math.PI * 2; duration: 10000; loops: Animation.Infinite
+ }
+
+ speedFromMovement: 20
+
+ speed: PointVector{ xVariation: 5; yVariation: 5;}
+ acceleration: PointVector{ xVariation: 5; yVariation: 5;}
+
+ particleSize: 16
+ //particleEndSize: 8
+ //particleSizeVariation: 8
+ }
+}
diff --git a/examples/declarative/particles/trails/shimmer.qml b/examples/declarative/particles/trails/shimmer.qml
new file mode 100644
index 0000000000..06f599d97a
--- /dev/null
+++ b/examples/declarative/particles/trails/shimmer.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import Qt.labs.particles 2.0
+
+Rectangle{
+ width: 360
+ height: 540
+ color: "black"
+ MouseArea{
+ anchors.fill: parent
+ onClicked: particles.running = !particles.running
+ }
+ ParticleSystem{
+ id: particles
+ running: false
+ }
+ ColoredParticle{
+ anchors.fill: parent
+ system: particles
+ image: "content/star.png"
+ sizeTable: "content/sparkleSize.png"
+ alpha: 0
+ colorVariation: 0.6
+ }
+ TrailEmitter{
+ anchors.fill: parent
+ system: particles
+ particlesPerSecond: 2000
+ particleDuration: 2000
+ emitting: true
+ particleSize: 30
+ particleSizeVariation: 10
+ }
+}
diff --git a/examples/declarative/particles/trails/swarm.qml b/examples/declarative/particles/trails/swarm.qml
new file mode 100644
index 0000000000..083f9e816d
--- /dev/null
+++ b/examples/declarative/particles/trails/swarm.qml
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** 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 examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANT