aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--.gitignore16
-rwxr-xr-xbin/rename-qtdeclarative-symbols.sh3
-rw-r--r--doc/config/qtquick.qdocconf3
-rw-r--r--doc/src/examples/examples-groups.qdoc29
-rw-r--r--doc/src/examples/examples-toys.qdoc7
-rw-r--r--doc/src/localstorage/localstorage.qdoc17
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-basic.qml2
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml8
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml12
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml2
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-pathanim.qml12
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml2
-rw-r--r--doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml2
-rw-r--r--doc/src/whatsnew.qdoc7
-rw-r--r--examples/HACKING23
-rw-r--r--examples/README12
-rw-r--r--examples/demos/calculator/CalculatorCore/Button.qml84
-rw-r--r--examples/demos/calculator/CalculatorCore/Display.qml68
-rw-r--r--examples/demos/calculator/CalculatorCore/calculator.js95
-rw-r--r--examples/demos/calculator/CalculatorCore/images/button-.pngbin0 -> 1288 bytes
-rw-r--r--examples/demos/calculator/CalculatorCore/images/button-blue.pngbin0 -> 1565 bytes
-rw-r--r--examples/demos/calculator/CalculatorCore/images/button-green.pngbin0 -> 1543 bytes
-rw-r--r--examples/demos/calculator/CalculatorCore/images/button-purple.pngbin0 -> 1566 bytes
-rw-r--r--examples/demos/calculator/CalculatorCore/images/button-red.pngbin0 -> 1586 bytes
-rw-r--r--examples/demos/calculator/CalculatorCore/images/display.pngbin0 -> 998 bytes
-rw-r--r--examples/demos/calculator/CalculatorCore/qmldir2
-rw-r--r--examples/demos/calculator/calculator-desktop.qml136
-rw-r--r--examples/demos/calculator/calculator-mobile.qml164
-rw-r--r--examples/demos/calculator/calculator.pro9
-rw-r--r--examples/demos/calculator/calculator.qdoc37
-rw-r--r--examples/demos/calculator/main.cpp66
-rw-r--r--examples/demos/clocks/clocks.qml88
-rw-r--r--examples/demos/clocks/content/Clock.qml143
-rw-r--r--examples/demos/clocks/content/QuitButton.qml52
-rw-r--r--examples/demos/clocks/content/arrow.pngbin0 -> 692 bytes
-rw-r--r--examples/demos/clocks/content/background.pngbin0 -> 46895 bytes
-rw-r--r--examples/demos/clocks/content/center.pngbin0 -> 765 bytes
-rw-r--r--examples/demos/clocks/content/clock-night.pngbin0 -> 23359 bytes
-rw-r--r--examples/demos/clocks/content/clock.pngbin0 -> 20653 bytes
-rw-r--r--examples/demos/clocks/content/hour.pngbin0 -> 625 bytes
-rw-r--r--examples/demos/clocks/content/minute.pngbin0 -> 625 bytes
-rw-r--r--examples/demos/clocks/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/demos/clocks/content/second.pngbin0 -> 303 bytes
-rw-r--r--examples/demos/demos.pro2
-rw-r--r--examples/demos/flickr/content/Button.qml79
-rw-r--r--examples/demos/flickr/content/GridDelegate.qml111
-rw-r--r--examples/demos/flickr/content/ImageDetails.qml323
-rw-r--r--examples/demos/flickr/content/ListDelegate.qml64
-rw-r--r--examples/demos/flickr/content/Progress.qml88
-rw-r--r--examples/demos/flickr/content/RssModel.qml64
-rw-r--r--examples/demos/flickr/content/ScrollBar.qml81
-rw-r--r--examples/demos/flickr/content/Slider.qml91
-rw-r--r--examples/demos/flickr/content/TitleBar.qml128
-rw-r--r--examples/demos/flickr/content/ToolBar.qml69
-rw-r--r--examples/demos/flickr/content/UnifiedDelegate.qml154
-rw-r--r--examples/demos/flickr/content/images/gloss.pngbin0 -> 1236 bytes
-rw-r--r--examples/demos/flickr/content/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--examples/demos/flickr/content/images/lineedit.sci5
-rw-r--r--examples/demos/flickr/content/images/noise.pngbin0 -> 25447 bytes
-rw-r--r--examples/demos/flickr/content/images/particle.pngbin0 -> 5148 bytes
-rw-r--r--examples/demos/flickr/content/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--examples/demos/flickr/content/images/squareParticle.pngbin0 -> 933 bytes
-rw-r--r--examples/demos/flickr/content/images/stripes.pngbin0 -> 257 bytes
-rw-r--r--examples/demos/flickr/content/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--examples/demos/flickr/content/images/titlebar.sci5
-rw-r--r--examples/demos/flickr/content/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--examples/demos/flickr/content/images/toolbutton.sci5
-rw-r--r--examples/demos/flickr/content/qmldir10
-rw-r--r--examples/demos/flickr/flickr-90.qml52
-rw-r--r--examples/demos/flickr/flickr.qml158
-rw-r--r--examples/demos/flickr/flickr.qmlproject17
-rw-r--r--examples/demos/minehunt/MinehuntCore/Explosion.qml69
-rw-r--r--examples/demos/minehunt/MinehuntCore/Tile.qml128
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/back.pngbin0 -> 558 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/background.pngbin0 -> 313930 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/bomb-color.pngbin0 -> 284 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/bomb.pngbin0 -> 535 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/face-sad.pngbin0 -> 14844 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/face-smile-big.pngbin0 -> 13810 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/flag-color.pngbin0 -> 219 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/flag.pngbin0 -> 196 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/front.pngbin0 -> 580 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/pics/star.pngbin0 -> 2677 bytes
-rw-r--r--examples/demos/minehunt/MinehuntCore/qmldir2
-rw-r--r--examples/demos/minehunt/README6
-rw-r--r--examples/demos/minehunt/main.cpp64
-rw-r--r--examples/demos/minehunt/minehunt.cpp221
-rw-r--r--examples/demos/minehunt/minehunt.h129
-rw-r--r--examples/demos/minehunt/minehunt.pro5
-rw-r--r--examples/demos/minehunt/minehunt.qml112
-rw-r--r--examples/demos/minehunt/minehunt.qmlproject16
-rw-r--r--examples/demos/minehunt/minehunt.qrc20
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml147
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml50
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/Button.qml72
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/EditableButton.qml86
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml188
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/ProgressBar.qml57
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/RssModel.qml57
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/Tag.qml91
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/images/box-shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/images/cardboard.pngbin0 -> 8844 bytes
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/qmldir8
-rw-r--r--examples/demos/photoviewer/PhotoViewerCore/script/script.js27
-rw-r--r--examples/demos/photoviewer/i18n/base.ts30
-rw-r--r--examples/demos/photoviewer/i18n/qml_fr.qmbin0 -> 268 bytes
-rw-r--r--examples/demos/photoviewer/i18n/qml_fr.ts30
-rw-r--r--examples/demos/photoviewer/photoviewer.qml110
-rw-r--r--examples/demos/photoviewer/photoviewer.qmlproject20
-rw-r--r--examples/demos/plasmapatrol/PlasmaPatrol.qmlproject19
-rw-r--r--examples/demos/plasmapatrol/TODO10
-rw-r--r--examples/demos/plasmapatrol/content/BlasterHardpoint.qml133
-rw-r--r--examples/demos/plasmapatrol/content/Button.qml66
-rw-r--r--examples/demos/plasmapatrol/content/CannonHardpoint.qml97
-rw-r--r--examples/demos/plasmapatrol/content/ChoiceBox.qml105
-rw-r--r--examples/demos/plasmapatrol/content/Cruiser.qml146
-rw-r--r--examples/demos/plasmapatrol/content/Frigate.qml114
-rw-r--r--examples/demos/plasmapatrol/content/Hardpoint.qml114
-rw-r--r--examples/demos/plasmapatrol/content/HelpScreens.qml268
-rw-r--r--examples/demos/plasmapatrol/content/LaserHardpoint.qml108
-rw-r--r--examples/demos/plasmapatrol/content/PlasmaPatrolParticles.qml173
-rw-r--r--examples/demos/plasmapatrol/content/SequentialLoader.qml54
-rw-r--r--examples/demos/plasmapatrol/content/Ship.qml114
-rw-r--r--examples/demos/plasmapatrol/content/Sloop.qml108
-rw-r--r--examples/demos/plasmapatrol/content/pics/TitleText.pngbin0 -> 1109 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/blur-circle2.pngbin0 -> 3627 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/blur-circle3.pngbin0 -> 5148 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/finalfrontier.pngbin0 -> 695061 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/meteor.pngbin0 -> 83169 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/meteor_explo.pngbin0 -> 81528 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/nullRock.pngbin0 -> 140 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/particle.pngbin0 -> 861 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/star.pngbin0 -> 1550 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/star2.pngbin0 -> 6507 bytes
-rw-r--r--examples/demos/plasmapatrol/content/pics/star3.pngbin0 -> 4602 bytes
-rw-r--r--examples/demos/plasmapatrol/plasmapatrol.qml386
-rw-r--r--examples/demos/rssnews/content/BusyIndicator.qml53
-rw-r--r--examples/demos/rssnews/content/CategoryDelegate.qml82
-rw-r--r--examples/demos/rssnews/content/NewsDelegate.qml71
-rw-r--r--examples/demos/rssnews/content/RssFeeds.qml59
-rw-r--r--examples/demos/rssnews/content/ScrollBar.qml107
-rw-r--r--examples/demos/rssnews/content/images/busy.pngbin0 -> 2629 bytes
-rw-r--r--examples/demos/rssnews/content/images/scrollbar.pngbin0 -> 161 bytes
-rw-r--r--examples/demos/rssnews/rssnews.qml112
-rw-r--r--examples/demos/rssnews/rssnews.qmlproject16
-rw-r--r--examples/demos/samegame/content/BoomBlock.qml112
-rw-r--r--examples/demos/samegame/content/Button.qml75
-rw-r--r--examples/demos/samegame/content/Dialog.qml81
-rw-r--r--examples/demos/samegame/content/GameArea.qml92
-rw-r--r--examples/demos/samegame/content/NameInputDialog.qml93
-rw-r--r--examples/demos/samegame/content/pics/background.pngbin0 -> 313930 bytes
-rw-r--r--examples/demos/samegame/content/pics/blueStone.pngbin0 -> 3054 bytes
-rw-r--r--examples/demos/samegame/content/pics/greenStone.pngbin0 -> 2932 bytes
-rw-r--r--examples/demos/samegame/content/pics/particle.pngbin0 -> 861 bytes
-rw-r--r--examples/demos/samegame/content/pics/redStone.pngbin0 -> 2902 bytes
-rw-r--r--examples/demos/samegame/content/pics/yellowStone.pngbin0 -> 3056 bytes
-rwxr-xr-xexamples/demos/samegame/content/samegame.js290
-rw-r--r--examples/demos/samegame/samegame.qml87
-rw-r--r--examples/demos/samegame/samegame.qmlproject16
-rw-r--r--examples/demos/snake/content/Button.qml66
-rw-r--r--examples/demos/snake/content/Cookie.qml102
-rw-r--r--examples/demos/snake/content/HighScoreModel.qml140
-rw-r--r--examples/demos/snake/content/Link.qml129
-rw-r--r--examples/demos/snake/content/Skull.qml62
-rw-r--r--examples/demos/snake/content/pics/README1
-rw-r--r--examples/demos/snake/content/pics/background.pngbin0 -> 144508 bytes
-rw-r--r--examples/demos/snake/content/pics/blueStar.pngbin0 -> 272 bytes
-rw-r--r--examples/demos/snake/content/pics/blueStone.pngbin0 -> 3139 bytes
-rw-r--r--examples/demos/snake/content/pics/cookie.pngbin0 -> 2729 bytes
-rw-r--r--examples/demos/snake/content/pics/eyes.svg118
-rw-r--r--examples/demos/snake/content/pics/head.pngbin0 -> 3473 bytes
-rw-r--r--examples/demos/snake/content/pics/pause.pngbin0 -> 4327 bytes
-rw-r--r--examples/demos/snake/content/pics/redStar.pngbin0 -> 273 bytes
-rw-r--r--examples/demos/snake/content/pics/redStone.pngbin0 -> 3456 bytes
-rw-r--r--examples/demos/snake/content/pics/skull.pngbin0 -> 2543 bytes
-rw-r--r--examples/demos/snake/content/pics/snake.jpgbin0 -> 663901 bytes
-rw-r--r--examples/demos/snake/content/pics/star.pngbin0 -> 262 bytes
-rw-r--r--examples/demos/snake/content/pics/stoneShadow.pngbin0 -> 1699 bytes
-rw-r--r--examples/demos/snake/content/pics/yellowStar.pngbin0 -> 276 bytes
-rw-r--r--examples/demos/snake/content/pics/yellowStone.pngbin0 -> 2667 bytes
-rw-r--r--examples/demos/snake/content/snake.js316
-rw-r--r--examples/demos/snake/snake.qml273
-rw-r--r--examples/demos/snake/snake.qmlproject16
-rw-r--r--examples/demos/tic-tac-toe/content/Button.qml79
-rw-r--r--examples/demos/tic-tac-toe/content/TicTac.qml60
-rw-r--r--examples/demos/tic-tac-toe/content/pics/board.pngbin0 -> 12258 bytes
-rw-r--r--examples/demos/tic-tac-toe/content/pics/o.pngbin0 -> 1470 bytes
-rw-r--r--examples/demos/tic-tac-toe/content/pics/x.pngbin0 -> 1331 bytes
-rw-r--r--examples/demos/tic-tac-toe/content/tic-tac-toe.js149
-rw-r--r--examples/demos/tic-tac-toe/tic-tac-toe.qml123
-rw-r--r--examples/demos/twitter/TwitterCore/Button.qml90
-rw-r--r--examples/demos/twitter/TwitterCore/FatDelegate.qml105
-rw-r--r--examples/demos/twitter/TwitterCore/Input.qml65
-rw-r--r--examples/demos/twitter/TwitterCore/Loading.qml49
-rw-r--r--examples/demos/twitter/TwitterCore/MultiTitleBar.qml60
-rw-r--r--examples/demos/twitter/TwitterCore/RssModel.qml80
-rw-r--r--examples/demos/twitter/TwitterCore/SearchView.qml124
-rw-r--r--examples/demos/twitter/TwitterCore/TitleBar.qml130
-rw-r--r--examples/demos/twitter/TwitterCore/ToolBar.qml64
-rw-r--r--examples/demos/twitter/TwitterCore/UserModel.qml66
-rw-r--r--examples/demos/twitter/TwitterCore/images/gloss.pngbin0 -> 1236 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/lineedit.sci5
-rw-r--r--examples/demos/twitter/TwitterCore/images/loading.pngbin0 -> 813 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/quit.pngbin0 -> 2369 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/stripes.pngbin0 -> 257 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/titlebar.sci5
-rw-r--r--examples/demos/twitter/TwitterCore/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--examples/demos/twitter/TwitterCore/images/toolbutton.sci5
-rw-r--r--examples/demos/twitter/TwitterCore/qmldir10
-rw-r--r--examples/demos/twitter/twitter.qml135
-rw-r--r--examples/demos/twitter/twitter.qmlproject16
-rw-r--r--examples/examples.pro2
-rw-r--r--examples/localstorage/hello.qml78
-rw-r--r--examples/localstorage/localstorage.pro1
-rw-r--r--examples/particles/affectors/age.qml97
-rw-r--r--examples/particles/affectors/attractor.qml213
-rw-r--r--examples/particles/affectors/customaffector.qml173
-rw-r--r--examples/particles/affectors/friction.qml109
-rw-r--r--examples/particles/affectors/gravity.qml103
-rw-r--r--examples/particles/affectors/groupgoal.qml193
-rw-r--r--examples/particles/affectors/move.qml141
-rw-r--r--examples/particles/affectors/spritegoal.qml212
-rw-r--r--examples/particles/affectors/turbulence.qml135
-rw-r--r--examples/particles/affectors/wander.qml95
-rw-r--r--examples/particles/customparticle/blurparticles.qml140
-rw-r--r--examples/particles/customparticle/fragmentshader.qml115
-rw-r--r--examples/particles/customparticle/imagecolors.qml118
-rw-r--r--examples/particles/emitters/burstandpulse.qml84
-rw-r--r--examples/particles/emitters/customemitter.qml92
-rw-r--r--examples/particles/emitters/emitmask.qml72
-rw-r--r--examples/particles/emitters/maximumemitted.qml81
-rw-r--r--examples/particles/emitters/shapeanddirection.qml112
-rw-r--r--examples/particles/emitters/timedgroupchanges.qml121
-rw-r--r--examples/particles/emitters/trailemitter.qml175
-rw-r--r--examples/particles/emitters/velocityfrommotion.qml311
-rw-r--r--examples/particles/exampleslauncher/content/Button.qml73
-rw-r--r--examples/particles/exampleslauncher/content/Shell.qml78
-rw-r--r--examples/particles/exampleslauncher/content/launcher.js8
-rw-r--r--examples/particles/exampleslauncher/exampleslauncher.qml116
-rw-r--r--examples/particles/imageparticle/allatonce.qml98
-rw-r--r--examples/particles/imageparticle/colored.qml86
-rw-r--r--examples/particles/imageparticle/colortable.qml84
-rw-r--r--examples/particles/imageparticle/deformation.qml121
-rw-r--r--examples/particles/imageparticle/rotation.qml71
-rw-r--r--examples/particles/imageparticle/sharing.qml199
-rw-r--r--examples/particles/imageparticle/sprites.qml116
-rw-r--r--examples/particles/images/_explo.pngbin0 -> 81528 bytes
-rwxr-xr-xexamples/particles/images/backgroundLeaves.jpgbin0 -> 78665 bytes
-rw-r--r--examples/particles/images/bear_tiles.pngbin0 -> 40349 bytes
-rw-r--r--examples/particles/images/candle.pngbin0 -> 1348 bytes
-rw-r--r--examples/particles/images/colortable.pngbin0 -> 704 bytes
-rw-r--r--examples/particles/images/finalfrontier.pngbin0 -> 695061 bytes
-rw-r--r--examples/particles/images/flower.pngbin0 -> 4683 bytes
-rw-r--r--examples/particles/images/launcherIcons/allatonce.pngbin0 -> 7075 bytes
-rw-r--r--examples/particles/images/launcherIcons/attractor.pngbin0 -> 31296 bytes
-rw-r--r--examples/particles/images/launcherIcons/blurparticles.pngbin0 -> 19109 bytes
-rw-r--r--examples/particles/images/launcherIcons/close.pngbin0 -> 2144 bytes
-rw-r--r--examples/particles/images/launcherIcons/colortable.pngbin0 -> 6538 bytes
-rw-r--r--examples/particles/images/launcherIcons/customaffector.pngbin0 -> 10350 bytes
-rw-r--r--examples/particles/images/launcherIcons/customemitter.pngbin0 -> 22967 bytes
-rw-r--r--examples/particles/images/launcherIcons/deformation.pngbin0 -> 2870 bytes
-rw-r--r--examples/particles/images/launcherIcons/delegates.pngbin0 -> 1892 bytes
-rw-r--r--examples/particles/images/launcherIcons/dynamicemitters.pngbin0 -> 9347 bytes
-rw-r--r--examples/particles/images/launcherIcons/emitmask.pngbin0 -> 45055 bytes
-rw-r--r--examples/particles/images/launcherIcons/flickr.pngbin0 -> 10542 bytes
-rw-r--r--examples/particles/images/launcherIcons/fragmentshader.pngbin0 -> 22294 bytes
-rw-r--r--examples/particles/images/launcherIcons/gridsplosion.pngbin0 -> 8154 bytes
-rw-r--r--examples/particles/images/launcherIcons/groupgoal.pngbin0 -> 7173 bytes
-rw-r--r--examples/particles/images/launcherIcons/imagecolors.pngbin0 -> 56647 bytes
-rw-r--r--examples/particles/images/launcherIcons/list.pngbin0 -> 32912 bytes
-rw-r--r--examples/particles/images/launcherIcons/maximumemitted.pngbin0 -> 1019 bytes
-rw-r--r--examples/particles/images/launcherIcons/multiplepainters.pngbin0 -> 8572 bytes
-rw-r--r--examples/particles/images/launcherIcons/package.pngbin0 -> 3163 bytes
-rw-r--r--examples/particles/images/launcherIcons/particleview.pngbin0 -> 26560 bytes
-rw-r--r--examples/particles/images/launcherIcons/plasmapatrol.pngbin0 -> 9839 bytes
-rw-r--r--examples/particles/images/launcherIcons/remove.pngbin0 -> 2144 bytes
-rw-r--r--examples/particles/images/launcherIcons/rotation.pngbin0 -> 20661 bytes
-rw-r--r--examples/particles/images/launcherIcons/samegame.pngbin0 -> 8647 bytes
-rw-r--r--examples/particles/images/launcherIcons/shapeanddirection.pngbin0 -> 11359 bytes
-rw-r--r--examples/particles/images/launcherIcons/spaceexplorer.pngbin0 -> 9152 bytes
-rw-r--r--examples/particles/images/launcherIcons/spritegoal.pngbin0 -> 35579 bytes
-rw-r--r--examples/particles/images/launcherIcons/sprites.pngbin0 -> 17009 bytes
-rw-r--r--examples/particles/images/launcherIcons/spritevariedparticles.pngbin0 -> 2569 bytes
-rw-r--r--examples/particles/images/launcherIcons/startstop.pngbin0 -> 13670 bytes
-rw-r--r--examples/particles/images/launcherIcons/timedgroupchanges.pngbin0 -> 16139 bytes
-rw-r--r--examples/particles/images/launcherIcons/trailemitter.pngbin0 -> 5371 bytes
-rw-r--r--examples/particles/images/launcherIcons/trails.pngbin0 -> 23168 bytes
-rw-r--r--examples/particles/images/launcherIcons/turbulence.pngbin0 -> 9684 bytes
-rw-r--r--examples/particles/images/launcherIcons/velocityfrommotion.pngbin0 -> 36360 bytes
-rw-r--r--examples/particles/images/launcherIcons/wander.pngbin0 -> 5858 bytes
-rw-r--r--examples/particles/images/matchmask.pngbin0 -> 2369 bytes
-rw-r--r--examples/particles/images/meteor.pngbin0 -> 83169 bytes
-rw-r--r--examples/particles/images/meteor_explo.pngbin0 -> 219946 bytes
-rw-r--r--examples/particles/images/meteors.pngbin0 -> 132137 bytes
-rw-r--r--examples/particles/images/nullRock.pngbin0 -> 140 bytes
-rw-r--r--examples/particles/images/particle.pngbin0 -> 861 bytes
-rw-r--r--examples/particles/images/particle2.pngbin0 -> 3909 bytes
-rw-r--r--examples/particles/images/particle3.pngbin0 -> 3186 bytes
-rw-r--r--examples/particles/images/particle4.pngbin0 -> 1799 bytes
-rw-r--r--examples/particles/images/particleA.pngbin0 -> 3541 bytes
-rw-r--r--examples/particles/images/portal_bg.pngbin0 -> 96858 bytes
-rw-r--r--examples/particles/images/realLeaf1.pngbin0 -> 15625 bytes
-rw-r--r--examples/particles/images/realLeaf2.pngbin0 -> 13660 bytes
-rw-r--r--examples/particles/images/realLeaf3.pngbin0 -> 23809 bytes
-rw-r--r--examples/particles/images/realLeaf4.pngbin0 -> 23655 bytes
-rw-r--r--examples/particles/images/rocket.pngbin0 -> 7315 bytes
-rw-r--r--examples/particles/images/rocket2.pngbin0 -> 1918 bytes
-rw-r--r--examples/particles/images/sizeInOut.pngbin0 -> 251 bytes
-rw-r--r--examples/particles/images/snowflake.pngbin0 -> 189327 bytes
-rw-r--r--examples/particles/images/sparkleSize.pngbin0 -> 378 bytes
-rw-r--r--examples/particles/images/star.pngbin0 -> 1550 bytes
-rw-r--r--examples/particles/images/starfish_0.pngbin0 -> 15972 bytes
-rw-r--r--examples/particles/images/starfish_1.pngbin0 -> 15746 bytes
-rw-r--r--examples/particles/images/starfish_2.pngbin0 -> 16067 bytes
-rw-r--r--examples/particles/images/starfish_3.pngbin0 -> 16201 bytes
-rw-r--r--examples/particles/images/starfish_4.pngbin0 -> 14698 bytes
-rw-r--r--examples/particles/images/starfish_mask.pngbin0 -> 11301 bytes
-rw-r--r--examples/particles/itemparticle/content/Delegate.qml88
-rw-r--r--examples/particles/itemparticle/content/Delegate2.qml79
-rw-r--r--examples/particles/itemparticle/content/ExpandingDelegate.qml204
-rw-r--r--examples/particles/itemparticle/content/RssModel.qml56
-rw-r--r--examples/particles/itemparticle/content/bubble.pngbin0 -> 3413 bytes
-rw-r--r--examples/particles/itemparticle/content/script.js27
-rw-r--r--examples/particles/itemparticle/delegates.qml91
-rw-r--r--examples/particles/itemparticle/particleview.qml274
-rw-r--r--examples/particles/particles.pro1
-rw-r--r--examples/particles/simple/dynamiccomparison.qml126
-rw-r--r--examples/particles/simple/dynamicemitters.qml122
-rw-r--r--examples/particles/simple/multiplepainters.qml90
-rw-r--r--examples/particles/simple/startstop.qml81
-rw-r--r--examples/qml/cppextensions/imageprovider/imageprovider.cpp6
-rw-r--r--examples/qml/cppextensions/imageprovider/imageprovider.json1
-rw-r--r--examples/qml/cppextensions/imageprovider/imageprovider.pro2
-rw-r--r--examples/qml/cppextensions/plugins/plugin.cpp6
-rw-r--r--examples/qml/cppextensions/plugins/plugin.json1
-rw-r--r--examples/qml/cppextensions/plugins/plugins.pro8
-rw-r--r--examples/qml/cppextensions/referenceexamples/attached/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/binding/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/coercion/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/default/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/grouped/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/methods/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/properties/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/signal/birthdayparty.cpp2
-rw-r--r--examples/qml/cppextensions/referenceexamples/valuesource/birthdayparty.cpp2
-rw-r--r--examples/qml/dynamicscene/content/Button.qml80
-rw-r--r--examples/qml/dynamicscene/content/GenericSceneItem.qml49
-rw-r--r--examples/qml/dynamicscene/content/PaletteItem.qml59
-rw-r--r--examples/qml/dynamicscene/content/PerspectiveItem.qml65
-rw-r--r--examples/qml/dynamicscene/content/Sun.qml78
-rw-r--r--examples/qml/dynamicscene/content/images/NOTE1
-rw-r--r--examples/qml/dynamicscene/content/images/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/qml/dynamicscene/content/images/moon.pngbin0 -> 1757 bytes
-rw-r--r--examples/qml/dynamicscene/content/images/rabbit_brown.pngbin0 -> 1245 bytes
-rw-r--r--examples/qml/dynamicscene/content/images/rabbit_bw.pngbin0 -> 1759 bytes
-rw-r--r--examples/qml/dynamicscene/content/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/qml/dynamicscene/content/images/sun.pngbin0 -> 8153 bytes
-rw-r--r--examples/qml/dynamicscene/content/images/tree_s.pngbin0 -> 3406 bytes
-rw-r--r--examples/qml/dynamicscene/content/itemCreation.js62
-rw-r--r--examples/qml/dynamicscene/dynamicscene.qml275
-rw-r--r--examples/qml/qml.pro37
-rw-r--r--examples/qml/xmlhttprequest/data.xml5
-rw-r--r--examples/qml/xmlhttprequest/xmlhttprequest-example.qml95
-rw-r--r--examples/quick/accessibility/accessibility.pro10
-rw-r--r--examples/quick/accessibility/accessibility.qml110
-rw-r--r--examples/quick/accessibility/accessibility.qmlproject16
-rw-r--r--examples/quick/accessibility/content/Button.qml80
-rw-r--r--examples/quick/accessibility/main.cpp41
-rw-r--r--examples/quick/animation/animation.pro10
-rw-r--r--examples/quick/animation/animation.qml93
-rw-r--r--examples/quick/animation/animation.qmlproject16
-rw-r--r--examples/quick/animation/basics/color-animation.qml121
-rw-r--r--examples/quick/animation/basics/images/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/quick/animation/basics/images/moon.pngbin0 -> 2433 bytes
-rw-r--r--examples/quick/animation/basics/images/shadow.pngbin0 -> 425 bytes
-rw-r--r--examples/quick/animation/basics/images/star.pngbin0 -> 349 bytes
-rw-r--r--examples/quick/animation/basics/images/sun.pngbin0 -> 8153 bytes
-rw-r--r--examples/quick/animation/basics/property-animation.qml105
-rw-r--r--examples/quick/animation/behaviors/SideRect.qml62
-rw-r--r--examples/quick/animation/behaviors/behavior-example.qml118
-rw-r--r--examples/quick/animation/behaviors/tvtennis.qml109
-rw-r--r--examples/quick/animation/behaviors/wigglytext.qml108
-rw-r--r--examples/quick/animation/easing/content/QuitButton.qml52
-rw-r--r--examples/quick/animation/easing/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/quick/animation/easing/easing.qml157
-rw-r--r--examples/quick/animation/main.cpp41
-rw-r--r--examples/quick/animation/pathanimation/pathanimation.qml105
-rw-r--r--examples/quick/animation/pathinterpolator/pathinterpolator.qml112
-rw-r--r--examples/quick/animation/states/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/quick/animation/states/states.qml101
-rw-r--r--examples/quick/animation/states/transitions.qml130
-rw-r--r--examples/quick/canvas/bezierCurve/bezierCurve.qml124
-rw-r--r--examples/quick/canvas/clip/clip.qml150
-rw-r--r--examples/quick/canvas/contents/Button.qml87
-rw-r--r--examples/quick/canvas/contents/ScrollBar.qml74
-rw-r--r--examples/quick/canvas/contents/Slider.qml115
-rw-r--r--examples/quick/canvas/contents/Stocks.qml147
-rw-r--r--examples/quick/canvas/contents/TitleBar.qml70
-rw-r--r--examples/quick/canvas/contents/ToolBar.qml69
-rw-r--r--examples/quick/canvas/contents/images/button-pressed.pngbin0 -> 571 bytes
-rw-r--r--examples/quick/canvas/contents/images/button.pngbin0 -> 564 bytes
-rw-r--r--examples/quick/canvas/contents/images/default.svg82
-rwxr-xr-xexamples/quick/canvas/contents/images/gloss.pngbin0 -> 1236 bytes
-rwxr-xr-xexamples/quick/canvas/contents/images/lineedit.pngbin0 -> 1415 bytes
-rw-r--r--examples/quick/canvas/contents/images/lineedit.sci5
-rwxr-xr-xexamples/quick/canvas/contents/images/quit.pngbin0 -> 2369 bytes
-rwxr-xr-xexamples/quick/canvas/contents/images/stripes.pngbin0 -> 257 bytes
-rwxr-xr-xexamples/quick/canvas/contents/images/titlebar.pngbin0 -> 1436 bytes
-rw-r--r--examples/quick/canvas/contents/images/titlebar.sci5
-rwxr-xr-xexamples/quick/canvas/contents/images/toolbutton.pngbin0 -> 2550 bytes
-rw-r--r--examples/quick/canvas/contents/images/toolbutton.sci5
-rw-r--r--examples/quick/canvas/contents/qt-logo.pngbin0 -> 23519 bytes
-rw-r--r--examples/quick/canvas/quadraticCurveTo/quadraticCurveTo.qml128
-rw-r--r--examples/quick/canvas/roundedrect/roundedrect.qml125
-rw-r--r--examples/quick/canvas/smile/smile.qml128
-rw-r--r--examples/quick/canvas/squircle/squircle.pngbin0 -> 771 bytes
-rw-r--r--examples/quick/canvas/squircle/squircle.qml155
-rw-r--r--examples/quick/canvas/stockchart/README5
-rw-r--r--examples/quick/canvas/stockchart/com/nokia/StockChartExample/qmldir1
-rw-r--r--examples/quick/canvas/stockchart/model.cpp255
-rw-r--r--examples/quick/canvas/stockchart/model.h166
-rw-r--r--examples/quick/canvas/stockchart/plugin.cpp60
-rw-r--r--examples/quick/canvas/stockchart/stock.qml726
-rw-r--r--examples/quick/canvas/stockchart/stockchart.pro20
-rw-r--r--examples/quick/canvas/tiger/tiger.js721
-rw-r--r--examples/quick/canvas/tiger/tiger.qml129
-rw-r--r--examples/quick/canvas/twitterfriends/TwitterUser.qml294
-rw-r--r--examples/quick/canvas/twitterfriends/cache.js42
-rw-r--r--examples/quick/canvas/twitterfriends/twitter.qml141
-rw-r--r--examples/quick/draganddrop/draganddrop.pro10
-rw-r--r--examples/quick/draganddrop/draganddrop.qml68
-rw-r--r--examples/quick/draganddrop/draganddrop.qmlproject16
-rw-r--r--examples/quick/draganddrop/main.cpp41
-rw-r--r--examples/quick/draganddrop/tiles/DragTile.qml90
-rw-r--r--examples/quick/draganddrop/tiles/DropTile.qml68
-rw-r--r--examples/quick/draganddrop/tiles/tiles.qml109
-rw-r--r--examples/quick/draganddrop/views/gridview.qml129
-rw-r--r--examples/quick/imageelements/animatedsprite.qml76
-rw-r--r--examples/quick/imageelements/borderimage.qml119
-rw-r--r--examples/quick/imageelements/content/BearSheet.pngbin0 -> 406337 bytes
-rw-r--r--examples/quick/imageelements/content/BorderImageSelector.qml96
-rw-r--r--examples/quick/imageelements/content/ImageCell.qml60
-rw-r--r--examples/quick/imageelements/content/MyBorderImage.qml90
-rw-r--r--examples/quick/imageelements/content/ShadowRectangle.qml54
-rw-r--r--examples/quick/imageelements/content/bw.pngbin0 -> 1357 bytes
-rw-r--r--examples/quick/imageelements/content/colors-round.sci7
-rw-r--r--examples/quick/imageelements/content/colors-stretch.sci5
-rw-r--r--examples/quick/imageelements/content/colors.pngbin0 -> 1655 bytes
-rw-r--r--examples/quick/imageelements/content/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/quick/imageelements/content/shadow.pngbin0 -> 588 bytes
-rw-r--r--examples/quick/imageelements/content/speaker.pngbin0 -> 784525 bytes
-rw-r--r--examples/quick/imageelements/image.qml66
-rw-r--r--examples/quick/imageelements/imageelements.pro10
-rw-r--r--examples/quick/imageelements/imageelements.qml77
-rw-r--r--examples/quick/imageelements/imageelements.qmlproject16
-rw-r--r--examples/quick/imageelements/main.cpp41
-rw-r--r--examples/quick/imageelements/shadows.qml64
-rw-r--r--examples/quick/imageelements/spritesequence.qml116
-rw-r--r--examples/quick/keyinteraction/focus/Core/ContextMenu.qml65
-rw-r--r--examples/quick/keyinteraction/focus/Core/GridMenu.qml105
-rw-r--r--examples/quick/keyinteraction/focus/Core/ListMenu.qml105
-rw-r--r--examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml85
-rw-r--r--examples/quick/keyinteraction/focus/Core/images/arrow.pngbin0 -> 583 bytes
-rw-r--r--examples/quick/keyinteraction/focus/Core/images/qt-logo.pngbin0 -> 5149 bytes
-rw-r--r--examples/quick/keyinteraction/focus/focus.qml111
-rw-r--r--examples/quick/modelviews/abstractitemmodel/abstractitemmodel.pro10
-rw-r--r--examples/quick/modelviews/abstractitemmodel/abstractitemmodel.qrc6
-rw-r--r--examples/quick/modelviews/abstractitemmodel/main.cpp70
-rw-r--r--examples/quick/modelviews/abstractitemmodel/model.cpp90
-rw-r--r--examples/quick/modelviews/abstractitemmodel/model.h83
-rw-r--r--examples/quick/modelviews/abstractitemmodel/view.qml50
-rw-r--r--examples/quick/modelviews/gridview/gridview-example.qml93
-rw-r--r--examples/quick/modelviews/gridview/pics/AddressBook_48.pngbin0 -> 3350 bytes
-rw-r--r--examples/quick/modelviews/gridview/pics/AudioPlayer_48.pngbin0 -> 3806 bytes
-rw-r--r--examples/quick/modelviews/gridview/pics/Camera_48.pngbin0 -> 3540 bytes
-rw-r--r--examples/quick/modelviews/gridview/pics/DateBook_48.pngbin0 -> 2610 bytes
-rw-r--r--examples/quick/modelviews/gridview/pics/EMail_48.pngbin0 -> 3655 bytes
-rw-r--r--examples/quick/modelviews/gridview/pics/TodoList_48.pngbin0 -> 3429 bytes
-rw-r--r--examples/quick/modelviews/gridview/pics/VideoPlayer_48.pngbin0 -> 4151 bytes
-rw-r--r--examples/quick/modelviews/listview/content/PetsModel.qml98
-rw-r--r--examples/quick/modelviews/listview/content/PressAndHoldButton.qml82
-rw-r--r--examples/quick/modelviews/listview/content/RecipesModel.qml129
-rw-r--r--examples/quick/modelviews/listview/content/TextButton.qml78
-rw-r--r--examples/quick/modelviews/listview/content/ToggleButton.qml58
-rw-r--r--examples/quick/modelviews/listview/content/pics/arrow-down.pngbin0 -> 594 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/arrow-up.pngbin0 -> 692 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/fruit-salad.jpgbin0 -> 17952 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/hamburger.jpgbin0 -> 8572 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/lemonade.jpgbin0 -> 6645 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/list-delete.pngbin0 -> 831 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/minus-sign.pngbin0 -> 250 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/moreDown.pngbin0 -> 217 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/moreUp.pngbin0 -> 212 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/pancakes.jpgbin0 -> 9163 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/plus-sign.pngbin0 -> 462 bytes
-rw-r--r--examples/quick/modelviews/listview/content/pics/vegetable-soup.jpgbin0 -> 8639 bytes
-rw-r--r--examples/quick/modelviews/listview/dynamiclist.qml203
-rw-r--r--examples/quick/modelviews/listview/expandingdelegates.qml202
-rw-r--r--examples/quick/modelviews/listview/highlight.qml99
-rw-r--r--examples/quick/modelviews/listview/highlightranges.qml122
-rw-r--r--examples/quick/modelviews/listview/sections.qml127
-rw-r--r--examples/quick/modelviews/modelviews.pro8
-rw-r--r--examples/quick/modelviews/modelviews.qml64
-rw-r--r--examples/quick/modelviews/modelviews.qmlproject16
-rw-r--r--examples/quick/modelviews/objectlistmodel/dataobject.cpp78
-rw-r--r--examples/quick/modelviews/objectlistmodel/dataobject.h76
-rw-r--r--examples/quick/modelviews/objectlistmodel/main.cpp78
-rw-r--r--examples/quick/modelviews/objectlistmodel/objectlistmodel.pro6
-rw-r--r--examples/quick/modelviews/objectlistmodel/objectlistmodel.qmlproject14
-rw-r--r--examples/quick/modelviews/objectlistmodel/objectlistmodel.qrc5
-rw-r--r--examples/quick/modelviews/objectlistmodel/view.qml55
-rw-r--r--examples/quick/modelviews/package/Delegate.qml88
-rw-r--r--examples/quick/modelviews/package/view.qml80
-rw-r--r--examples/quick/modelviews/parallax/content/Clock.qml143
-rw-r--r--examples/quick/modelviews/parallax/content/ParallaxView.qml123
-rw-r--r--examples/quick/modelviews/parallax/content/QuitButton.qml52
-rw-r--r--examples/quick/modelviews/parallax/content/Smiley.qml84
-rw-r--r--examples/quick/modelviews/parallax/content/background.pngbin0 -> 46895 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/center.pngbin0 -> 765 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/clock-night.pngbin0 -> 23359 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/clock.pngbin0 -> 20653 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/hour.pngbin0 -> 625 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/minute.pngbin0 -> 625 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/pics/background.jpgbin0 -> 209814 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/pics/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/pics/home-page.pngbin0 -> 3051 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/pics/home-page.svg445
-rw-r--r--examples/quick/modelviews/parallax/content/pics/shadow.pngbin0 -> 425 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/pics/yast-joystick.pngbin0 -> 2723 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/pics/yast-wol.pngbin0 -> 3769 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/quick/modelviews/parallax/content/second.pngbin0 -> 303 bytes
-rw-r--r--examples/quick/modelviews/parallax/parallax.qml76
-rw-r--r--examples/quick/modelviews/pathview/pathview-example.qml107
-rw-r--r--examples/quick/modelviews/pathview/pics/AddressBook_48.pngbin0 -> 3350 bytes
-rw-r--r--examples/quick/modelviews/pathview/pics/AudioPlayer_48.pngbin0 -> 3806 bytes
-rw-r--r--examples/quick/modelviews/pathview/pics/Camera_48.pngbin0 -> 3540 bytes
-rw-r--r--examples/quick/modelviews/pathview/pics/DateBook_48.pngbin0 -> 2610 bytes
-rw-r--r--examples/quick/modelviews/pathview/pics/EMail_48.pngbin0 -> 3655 bytes
-rw-r--r--examples/quick/modelviews/pathview/pics/TodoList_48.pngbin0 -> 3429 bytes
-rw-r--r--examples/quick/modelviews/pathview/pics/VideoPlayer_48.pngbin0 -> 4151 bytes
-rw-r--r--examples/quick/modelviews/stringlistmodel/main.cpp77
-rw-r--r--examples/quick/modelviews/stringlistmodel/stringlistmodel.pro4
-rw-r--r--examples/quick/modelviews/stringlistmodel/stringlistmodel.qrc5
-rw-r--r--examples/quick/modelviews/stringlistmodel/view.qml54
-rw-r--r--examples/quick/modelviews/visualdatamodel/dragselection.qml200
-rw-r--r--examples/quick/modelviews/visualdatamodel/slideshow.qml156
-rw-r--r--examples/quick/modelviews/visualdatamodel/sortedmodel.qml141
-rw-r--r--examples/quick/modelviews/visualdatamodel/visualdatamodel.qmlproject14
-rw-r--r--examples/quick/modelviews/visualitemmodel/visualitemmodel.qml116
-rw-r--r--examples/quick/mousearea/mousearea-example.qml176
-rw-r--r--examples/quick/openglunderqml/main.cpp60
-rw-r--r--examples/quick/openglunderqml/main.qml78
-rw-r--r--examples/quick/openglunderqml/openglunderqml.pro6
-rw-r--r--examples/quick/openglunderqml/squircle.cpp123
-rw-r--r--examples/quick/openglunderqml/squircle.h76
-rw-r--r--examples/quick/painteditem/painteditem.pro5
-rw-r--r--examples/quick/painteditem/smile/main.cpp96
-rw-r--r--examples/quick/painteditem/smile/smile.pro11
-rw-r--r--examples/quick/painteditem/smile/smile.qml132
-rw-r--r--examples/quick/painteditem/textballoons/TextBalloonPlugin/plugin.h55
-rw-r--r--examples/quick/painteditem/textballoons/TextBalloonPlugin/qmldir1
-rw-r--r--examples/quick/painteditem/textballoons/textballoon.cpp92
-rw-r--r--examples/quick/painteditem/textballoons/textballoon.h68
-rw-r--r--examples/quick/painteditem/textballoons/textballoon.json1
-rw-r--r--examples/quick/painteditem/textballoons/textballoons.pro25
-rw-r--r--examples/quick/painteditem/textballoons/textballoons.qml110
-rw-r--r--examples/quick/positioners/content/Button.qml78
-rw-r--r--examples/quick/positioners/content/add.pngbin0 -> 810 bytes
-rw-r--r--examples/quick/positioners/content/del.pngbin0 -> 488 bytes
-rw-r--r--examples/quick/positioners/positioners-attachedproperties.qml106
-rw-r--r--examples/quick/positioners/positioners.qml268
-rw-r--r--examples/quick/quick.pro17
-rw-r--r--examples/quick/righttoleft/layoutdirection/layoutdirection.qml246
-rw-r--r--examples/quick/righttoleft/layoutdirection/layoutdirection.qmlproject16
-rw-r--r--examples/quick/righttoleft/layoutmirroring/layoutmirroring.qml313
-rw-r--r--examples/quick/righttoleft/layoutmirroring/layoutmirroring.qmlproject16
-rw-r--r--examples/quick/righttoleft/textalignment/textalignment.qml427
-rw-r--r--examples/quick/righttoleft/textalignment/textalignment.qmlproject16
-rw-r--r--examples/quick/shadereffects/content/Slider.qml93
-rw-r--r--examples/quick/shadereffects/content/face-smile.pngbin0 -> 15408 bytes
-rw-r--r--examples/quick/shadereffects/content/qt-logo.pngbin0 -> 13923 bytes
-rw-r--r--examples/quick/shadereffects/shadereffects.qml315
-rw-r--r--examples/quick/text/fonts/availableFonts.qml57
-rw-r--r--examples/quick/text/fonts/banner.qml61
-rw-r--r--examples/quick/text/fonts/content/fonts/tarzeau_ocr_a.ttfbin0 -> 24544 bytes
-rw-r--r--examples/quick/text/fonts/fonts.qml104
-rw-r--r--examples/quick/text/fonts/hello.qml79
-rw-r--r--examples/quick/text/imgtag/TextWithImage.qml55
-rw-r--r--examples/quick/text/imgtag/images/face-sad.pngbin0 -> 6148 bytes
-rw-r--r--examples/quick/text/imgtag/images/face-smile-big.pngbin0 -> 6058 bytes
-rw-r--r--examples/quick/text/imgtag/images/face-smile.pngbin0 -> 6446 bytes
-rw-r--r--examples/quick/text/imgtag/images/heart200.pngbin0 -> 8248 bytes
-rw-r--r--examples/quick/text/imgtag/images/qtlogo.pngbin0 -> 6450 bytes
-rw-r--r--examples/quick/text/imgtag/images/starfish_2.pngbin0 -> 18243 bytes
-rw-r--r--examples/quick/text/imgtag/imgtag.qml101
-rw-r--r--examples/quick/text/styledtext-layout.qml107
-rw-r--r--examples/quick/text/text.qml57
-rw-r--r--examples/quick/text/text.qmlproject16
-rw-r--r--examples/quick/text/textselection/pics/endHandle.pngbin0 -> 185 bytes
-rw-r--r--examples/quick/text/textselection/pics/endHandle.sci5
-rw-r--r--examples/quick/text/textselection/pics/startHandle.pngbin0 -> 178 bytes
-rw-r--r--examples/quick/text/textselection/pics/startHandle.sci5
-rw-r--r--examples/quick/text/textselection/textselection.qml211
-rw-r--r--examples/quick/threading/threadedlistmodel/dataloader.js49
-rw-r--r--examples/quick/threading/threadedlistmodel/threadedlistmodel.qmlproject56
-rw-r--r--examples/quick/threading/threadedlistmodel/timedisplay.qml76
-rw-r--r--examples/quick/threading/workerscript/workerscript.js15
-rw-r--r--examples/quick/threading/workerscript/workerscript.qml83
-rw-r--r--examples/quick/threading/workerscript/workerscript.qmlproject16
-rw-r--r--examples/quick/touchinteraction/flickable/content/Day.qml153
-rw-r--r--examples/quick/touchinteraction/flickable/content/cork.jpgbin0 -> 149337 bytes
-rw-r--r--examples/quick/touchinteraction/flickable/content/note-yellow.pngbin0 -> 54559 bytes
-rw-r--r--examples/quick/touchinteraction/flickable/content/tack.pngbin0 -> 7282 bytes
-rw-r--r--examples/quick/touchinteraction/flickable/corkboards.qml116
-rw-r--r--examples/quick/touchinteraction/multipointtouch/bearwhack.qml133
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/AugmentedTouchPoint.qml70
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/Bear0.pngbin0 -> 15163 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/Bear1.pngbin0 -> 99378 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/Bear2.pngbin0 -> 80759 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/Bear3.pngbin0 -> 21122 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/BearB.pngbin0 -> 18667 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml180
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/ParticleFlame.qml65
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/blur-circle.pngbin0 -> 4279 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/blur-circle3.pngbin0 -> 5148 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/heart-blur.pngbin0 -> 5406 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/content/title.pngbin0 -> 81252 bytes
-rw-r--r--examples/quick/touchinteraction/multipointtouch/multiflame.qml91
-rw-r--r--examples/quick/touchinteraction/pincharea/flickresize.qml97
-rw-r--r--examples/quick/touchinteraction/pincharea/qt-logo.jpgbin0 -> 40886 bytes
-rw-r--r--examples/quick/touchinteraction/touchinteraction.qml56
-rw-r--r--examples/quick/touchinteraction/touchinteraction.qmlproject16
-rw-r--r--examples/shared/Button.qml64
-rw-r--r--examples/shared/LauncherList.qml102
-rw-r--r--examples/shared/README11
-rw-r--r--examples/shared/SimpleLauncherDelegate.qml53
-rw-r--r--examples/shared/images/back.pngbin0 -> 404 bytes
-rw-r--r--examples/shared/qmldir3
-rw-r--r--examples/shared/shared.h49
-rw-r--r--examples/shared/shared.pro9
-rw-r--r--examples/tutorials/dynamicview/dynamicview1/PetsModel.qml102
-rw-r--r--examples/tutorials/dynamicview/dynamicview1/dynamicview.qml90
-rw-r--r--examples/tutorials/dynamicview/dynamicview2/PetsModel.qml98
-rw-r--r--examples/tutorials/dynamicview/dynamicview2/dynamicview.qml121
-rw-r--r--examples/tutorials/dynamicview/dynamicview3/PetsModel.qml98
-rw-r--r--examples/tutorials/dynamicview/dynamicview3/dynamicview.qml143
-rw-r--r--examples/tutorials/dynamicview/dynamicview4/ListSelector.qml120
-rw-r--r--examples/tutorials/dynamicview/dynamicview4/PetsModel.qml98
-rw-r--r--examples/tutorials/dynamicview/dynamicview4/dynamicview.qml219
-rw-r--r--examples/tutorials/extending/chapter1-basics/app.qml60
-rw-r--r--examples/tutorials/extending/chapter1-basics/chapter1-basics.pro5
-rw-r--r--examples/tutorials/extending/chapter1-basics/main.cpp57
-rw-r--r--examples/tutorials/extending/chapter1-basics/piechart.cpp79
-rw-r--r--examples/tutorials/extending/chapter1-basics/piechart.h71
-rw-r--r--examples/tutorials/extending/chapter2-methods/app.qml66
-rw-r--r--examples/tutorials/extending/chapter2-methods/chapter2-methods.pro5
-rw-r--r--examples/tutorials/extending/chapter2-methods/main.cpp57
-rw-r--r--examples/tutorials/extending/chapter2-methods/piechart.cpp84
-rw-r--r--examples/tutorials/extending/chapter2-methods/piechart.h84
-rw-r--r--examples/tutorials/extending/chapter3-bindings/app.qml74
-rw-r--r--examples/tutorials/extending/chapter3-bindings/chapter3-bindings.pro5
-rw-r--r--examples/tutorials/extending/chapter3-bindings/main.cpp57
-rw-r--r--examples/tutorials/extending/chapter3-bindings/piechart.cpp86
-rw-r--r--examples/tutorials/extending/chapter3-bindings/piechart.h84
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/app.qml60
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro7
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/main.cpp66
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/piechart.cpp70
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/piechart.h78
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/pieslice.cpp66
-rw-r--r--examples/tutorials/extending/chapter4-customPropertyTypes/pieslice.h66
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/app.qml70
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro7
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/main.cpp58
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/piechart.cpp72
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/piechart.h75
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/pieslice.cpp86
-rw-r--r--examples/tutorials/extending/chapter5-listproperties/pieslice.h76
-rw-r--r--examples/tutorials/extending/chapter6-plugins/ChartsPlugin/qmldir1
-rw-r--r--examples/tutorials/extending/chapter6-plugins/app.qml69
-rw-r--r--examples/tutorials/extending/chapter6-plugins/chapter6-plugins.pro18
-rw-r--r--examples/tutorials/extending/chapter6-plugins/chartsplugin.cpp53
-rw-r--r--examples/tutorials/extending/chapter6-plugins/chartsplugin.h57
-rw-r--r--examples/tutorials/extending/chapter6-plugins/chartsplugin.json1
-rw-r--r--examples/tutorials/extending/chapter6-plugins/piechart.cpp71
-rw-r--r--examples/tutorials/extending/chapter6-plugins/piechart.h69
-rw-r--r--examples/tutorials/extending/chapter6-plugins/pieslice.cpp86
-rw-r--r--examples/tutorials/extending/chapter6-plugins/pieslice.h74
-rw-r--r--examples/tutorials/extending/extending.pro10
-rw-r--r--examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.cpp3
-rw-r--r--examples/tutorials/gettingStartedQml/filedialog/dialogPlugin.h1
-rw-r--r--examples/tutorials/gettingStartedQml/filedialog/dialogplugin.json1
-rw-r--r--examples/tutorials/helloworld/Cell.qml72
-rw-r--r--examples/tutorials/helloworld/tutorial1.qml63
-rw-r--r--examples/tutorials/helloworld/tutorial2.qml72
-rw-r--r--examples/tutorials/helloworld/tutorial3.qml91
-rw-r--r--examples/tutorials/samegame/samegame1/Block.qml53
-rw-r--r--examples/tutorials/samegame/samegame1/Button.qml83
-rw-r--r--examples/tutorials/samegame/samegame1/samegame.qml82
-rw-r--r--examples/tutorials/samegame/samegame1/samegame1.qmlproject16
-rw-r--r--examples/tutorials/samegame/samegame2/Block.qml51
-rw-r--r--examples/tutorials/samegame/samegame2/Button.qml81
-rw-r--r--examples/tutorials/samegame/samegame2/samegame.js63
-rw-r--r--examples/tutorials/samegame/samegame2/samegame.qml85
-rw-r--r--examples/tutorials/samegame/samegame2/samegame2.qmlproject16
-rw-r--r--examples/tutorials/samegame/samegame3/Block.qml63
-rw-r--r--examples/tutorials/samegame/samegame3/Button.qml81
-rw-r--r--examples/tutorials/samegame/samegame3/Dialog.qml71
-rw-r--r--examples/tutorials/samegame/samegame3/samegame.js174
-rw-r--r--examples/tutorials/samegame/samegame3/samegame.qml109
-rw-r--r--examples/tutorials/samegame/samegame3/samegame3.qmlproject16
-rw-r--r--examples/tutorials/samegame/samegame4/content/BoomBlock.qml122
-rw-r--r--examples/tutorials/samegame/samegame4/content/Button.qml81
-rw-r--r--examples/tutorials/samegame/samegame4/content/Dialog.qml107
-rwxr-xr-xexamples/tutorials/samegame/samegame4/content/samegame.js226
-rw-r--r--examples/tutorials/samegame/samegame4/highscores/README1
-rwxr-xr-xexamples/tutorials/samegame/samegame4/highscores/score_data.xml2
-rwxr-xr-xexamples/tutorials/samegame/samegame4/highscores/score_style.xsl28
-rwxr-xr-xexamples/tutorials/samegame/samegame4/highscores/scores.php31
-rw-r--r--examples/tutorials/samegame/samegame4/samegame.qml115
-rw-r--r--examples/tutorials/samegame/samegame4/samegame4.qmlproject16
-rw-r--r--examples/tutorials/samegame/shared/pics/background.jpgbin0 -> 36473 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/blueStar.pngbin0 -> 278 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/blueStone.pngbin0 -> 3054 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/greenStar.pngbin0 -> 273 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/greenStone.pngbin0 -> 2932 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/redStar.pngbin0 -> 274 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/redStone.pngbin0 -> 2902 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/star.pngbin0 -> 262 bytes
-rw-r--r--examples/tutorials/samegame/shared/pics/yellowStone.pngbin0 -> 3056 bytes
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/Dial.qml86
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/QuitButton.qml52
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/background.pngbin0 -> 35876 bytes
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/needle.pngbin0 -> 342 bytes
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/needle_shadow.pngbin0 -> 632 bytes
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/overlay.pngbin0 -> 3564 bytes
-rw-r--r--examples/tutorials/ui-components/dialcontrol/content/quit.pngbin0 -> 583 bytes
-rw-r--r--examples/tutorials/ui-components/dialcontrol/dialcontrol.qml98
-rw-r--r--examples/tutorials/ui-components/flipable/content/5_heart.pngbin0 -> 3872 bytes
-rw-r--r--examples/tutorials/ui-components/flipable/content/9_club.pngbin0 -> 6135 bytes
-rw-r--r--examples/tutorials/ui-components/flipable/content/Card.qml80
-rw-r--r--examples/tutorials/ui-components/flipable/content/back.pngbin0 -> 1418 bytes
-rw-r--r--examples/tutorials/ui-components/flipable/flipable.qml55
-rw-r--r--examples/tutorials/ui-components/progressbar/content/ProgressBar.qml83
-rw-r--r--examples/tutorials/ui-components/progressbar/content/background.pngbin0 -> 426 bytes
-rw-r--r--examples/tutorials/ui-components/progressbar/main.qml73
-rw-r--r--examples/tutorials/ui-components/scrollbar/ScrollBar.qml74
-rw-r--r--examples/tutorials/ui-components/scrollbar/main.qml93
-rw-r--r--examples/tutorials/ui-components/scrollbar/pics/niagara_falls.jpgbin0 -> 142510 bytes
-rw-r--r--examples/tutorials/ui-components/scrollbar/scrollbar.qmlproject16
-rw-r--r--examples/tutorials/ui-components/searchbox/SearchBox.qml109
-rw-r--r--examples/tutorials/ui-components/searchbox/images/clear.pngbin0 -> 429 bytes
-rw-r--r--examples/tutorials/ui-components/searchbox/images/lineedit-bg-focus.pngbin0 -> 526 bytes
-rw-r--r--examples/tutorials/ui-components/searchbox/images/lineedit-bg.pngbin0 -> 426 bytes
-rw-r--r--examples/tutorials/ui-components/searchbox/main.qml60
-rw-r--r--examples/tutorials/ui-components/searchbox/searchbox.qmlproject16
-rw-r--r--examples/tutorials/ui-components/slideswitch/content/Switch.qml117
-rw-r--r--examples/tutorials/ui-components/slideswitch/content/background.pngbin0 -> 3091 bytes
-rw-r--r--examples/tutorials/ui-components/slideswitch/content/background.svg23
-rw-r--r--examples/tutorials/ui-components/slideswitch/content/knob.pngbin0 -> 3101 bytes
-rw-r--r--examples/tutorials/ui-components/slideswitch/content/knob.svg867
-rw-r--r--examples/tutorials/ui-components/slideswitch/slideswitch.qml51
-rw-r--r--examples/tutorials/ui-components/spinner/content/Spinner.qml70
-rw-r--r--examples/tutorials/ui-components/spinner/content/spinner-bg.pngbin0 -> 345 bytes
-rw-r--r--examples/tutorials/ui-components/spinner/content/spinner-select.pngbin0 -> 320 bytes
-rw-r--r--examples/tutorials/ui-components/spinner/main.qml61
-rw-r--r--examples/tutorials/ui-components/spinner/spinner.qmlproject16
-rw-r--r--examples/tutorials/ui-components/tabwidget/TabWidget.qml102
-rw-r--r--examples/tutorials/ui-components/tabwidget/main.qml99
-rw-r--r--examples/tutorials/ui-components/tabwidget/tab.pngbin0 -> 507 bytes
-rw-r--r--examples/tutorials/ui-components/tabwidget/tabwidget.qmlproject16
-rw-r--r--examples/window/Window.qml58
-rw-r--r--examples/window/screen/screenInfo.qml90
-rw-r--r--examples/window/standalone.qml71
-rw-r--r--examples/window/window.cpp58
-rw-r--r--examples/window/window.pro5
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp280
-rw-r--r--src/imports/folderlistmodel/fileinfothread_p.h107
-rw-r--r--src/imports/folderlistmodel/fileproperty_p.h94
-rw-r--r--src/imports/folderlistmodel/folderlistmodel.json1
-rw-r--r--src/imports/folderlistmodel/folderlistmodel.pro9
-rw-r--r--src/imports/folderlistmodel/plugin.cpp7
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp494
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.h60
-rw-r--r--src/imports/gestures/gestures.json1
-rw-r--r--src/imports/localstorage/localstorage.json1
-rw-r--r--src/imports/localstorage/localstorage.pro4
-rw-r--r--src/imports/localstorage/plugin.cpp4
-rw-r--r--src/imports/shaders/shaders.json1
-rw-r--r--src/imports/testlib/main.cpp4
-rw-r--r--src/imports/testlib/testlib.json1
-rw-r--r--src/imports/testlib/testlib.pro3
-rw-r--r--src/imports/xmllistmodel/plugin.cpp4
-rw-r--r--src/imports/xmllistmodel/xmllistmodel.json1
-rw-r--r--src/plugins/accessible/quick/accessible.json3
-rw-r--r--src/plugins/accessible/quick/main.cpp8
-rw-r--r--src/plugins/accessible/quick/quick.pro2
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qmldbg_qtquick2.pro2
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.h1
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qtquick2plugin.json2
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pro2
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.h2
-rw-r--r--src/plugins/qmltooling/qmldbg_tcp/qtcpserverconnection.json1
-rw-r--r--src/qml/debugger/qdebugmessageservice.cpp2
-rw-r--r--src/qml/debugger/qqmldebugserverconnection_p.h6
-rw-r--r--src/qml/debugger/qqmlinspectorinterface_p.h5
-rw-r--r--src/qml/debugger/qqmlprofilerservice.cpp62
-rw-r--r--src/qml/debugger/qqmlprofilerservice_p.h158
-rw-r--r--src/qml/debugger/qv8profilerservice.cpp14
-rw-r--r--src/qml/debugger/qv8profilerservice_p.h1
-rw-r--r--src/qml/qml/ftw/qfastmetabuilder.cpp64
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp15
-rw-r--r--src/qml/qml/qqmlcompiler.cpp30
-rw-r--r--src/qml/qml/qqmlcompiler_p.h1
-rw-r--r--src/qml/qml/qqmlcomponent.cpp22
-rw-r--r--src/qml/qml/qqmlcomponent_p.h4
-rw-r--r--src/qml/qml/qqmlengine.cpp16
-rw-r--r--src/qml/qml/qqmlexpression.cpp4
-rw-r--r--src/qml/qml/qqmlextensioninterface.h7
-rw-r--r--src/qml/qml/qqmlimageprovider.h2
-rw-r--r--src/qml/qml/qqmlincubator.cpp7
-rw-r--r--src/qml/qml/qqmlincubator.h3
-rw-r--r--src/qml/qml/qqmlinstruction.cpp4
-rw-r--r--src/qml/qml/qqmllocale.cpp5
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp2
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h1
-rw-r--r--src/qml/qml/qqmlpropertyvalueinterceptor_p.h5
-rw-r--r--src/qml/qml/qqmlpropertyvaluesource.h5
-rw-r--r--src/qml/qml/qqmlrewrite.cpp123
-rw-r--r--src/qml/qml/qqmlrewrite_p.h5
-rw-r--r--src/qml/qml/qqmltypeloader.cpp6
-rw-r--r--src/qml/qml/qqmlvme_p.h24
-rw-r--r--src/qml/qml/qquickworkerscript.cpp2
-rw-r--r--src/qml/qml/v4/qv4bindings.cpp79
-rw-r--r--src/qml/qml/v4/qv4bindings_p.h2
-rw-r--r--src/qml/qml/v4/qv4compiler.cpp25
-rw-r--r--src/qml/qml/v4/qv4compiler_p_p.h1
-rw-r--r--src/qml/qml/v4/qv4instruction.cpp9
-rw-r--r--src/qml/qml/v4/qv4instruction_p.h3
-rw-r--r--src/qml/qml/v4/qv4ir.cpp3
-rw-r--r--src/qml/qml/v4/qv4ir_p.h1
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp9
-rw-r--r--src/qml/qml/v4/qv4program_p.h1
-rw-r--r--src/qml/qml/v8/qjsconverter_p.h38
-rw-r--r--src/qml/qml/v8/qjsengine.h38
-rw-r--r--src/qml/qml/v8/qjsengine_p.h40
-rw-r--r--src/qml/qml/v8/qjsvalue.h41
-rw-r--r--src/qml/qml/v8/qjsvalue_impl_p.h38
-rw-r--r--src/qml/qml/v8/qjsvalue_p.h38
-rw-r--r--src/qml/qml/v8/qjsvalueiterator.h39
-rw-r--r--src/qml/qml/v8/qjsvalueiterator_impl_p.h36
-rw-r--r--src/qml/qml/v8/qjsvalueiterator_p.h36
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp19
-rw-r--r--src/qml/qml/v8/qscript_impl_p.h40
-rw-r--r--src/qml/qml/v8/qscriptisolate_p.h38
-rw-r--r--src/qml/qml/v8/qscriptoriginalglobalobject_p.h38
-rw-r--r--src/qml/qml/v8/qscriptshareddata_p.h38
-rw-r--r--src/qml/qml/v8/qscripttools_p.h38
-rw-r--r--src/qml/qml/v8/qv8engine.cpp10
-rw-r--r--src/qml/qml/v8/qv8engine_impl_p.h36
-rw-r--r--src/qml/qml/v8/qv8engine_p.h2
-rw-r--r--src/qml/qml/v8/qv8qobjectwrapper.cpp4
-rw-r--r--src/quick/items/items.pri8
-rw-r--r--src/quick/items/qquickanimatedsprite.cpp613
-rw-r--r--src/quick/items/qquickanimatedsprite_p.h373
-rw-r--r--src/quick/items/qquickcanvas.cpp30
-rw-r--r--src/quick/items/qquickevents_p_p.h14
-rw-r--r--src/quick/items/qquickflickable.cpp17
-rw-r--r--src/quick/items/qquickgridview.cpp163
-rw-r--r--src/quick/items/qquickitem.cpp6
-rw-r--r--src/quick/items/qquickitem_p.h4
-rw-r--r--src/quick/items/qquickitemanimation.cpp2
-rw-r--r--src/quick/items/qquickitemsmodule.cpp8
-rw-r--r--src/quick/items/qquickitemview.cpp921
-rw-r--r--src/quick/items/qquickitemview_p.h51
-rw-r--r--src/quick/items/qquickitemview_p_p.h92
-rw-r--r--src/quick/items/qquickitemviewtransition.cpp876
-rw-r--r--src/quick/items/qquickitemviewtransition_p.h209
-rw-r--r--src/quick/items/qquicklistview.cpp273
-rw-r--r--src/quick/items/qquicklistview_p.h3
-rw-r--r--src/quick/items/qquickpositioners.cpp375
-rw-r--r--src/quick/items/qquickpositioners_p.h16
-rw-r--r--src/quick/items/qquickpositioners_p_p.h11
-rw-r--r--src/quick/items/qquicksprite.cpp4
-rw-r--r--src/quick/items/qquicksprite_p.h24
-rw-r--r--src/quick/items/qquickspriteengine.cpp2
-rw-r--r--src/quick/items/qquickspriteengine_p.h2
-rw-r--r--src/quick/items/qquickspritesequence.cpp482
-rw-r--r--src/quick/items/qquickspritesequence_p.h148
-rw-r--r--src/quick/items/qquickstateoperations.cpp3
-rw-r--r--src/quick/items/qquicktext.cpp331
-rw-r--r--src/quick/items/qquicktext_p_p.h46
-rw-r--r--src/quick/items/qquicktextcontrol.cpp94
-rw-r--r--src/quick/items/qquicktextcontrol_p.h12
-rw-r--r--src/quick/items/qquicktextcontrol_p_p.h55
-rw-r--r--src/quick/items/qquicktextedit.cpp65
-rw-r--r--src/quick/items/qquicktextedit_p.h6
-rw-r--r--src/quick/items/qquicktextedit_p_p.h79
-rw-r--r--src/quick/items/qquicktextinput.cpp42
-rw-r--r--src/quick/items/qquicktextinput_p.h4
-rw-r--r--src/quick/items/qquicktextinput_p_p.h13
-rw-r--r--src/quick/items/qquickvisualadaptormodel_p.h4
-rw-r--r--src/quick/items/qquickvisualdatamodel.cpp41
-rw-r--r--src/quick/items/qquickvisualdatamodel_p.h1
-rw-r--r--src/quick/items/qquickvisualitemmodel_p.h1
-rw-r--r--src/quick/items/qquickwindowmanager.cpp176
-rw-r--r--src/quick/items/qquickwindowmanager_p.h5
-rw-r--r--src/quick/items/qquickwindowmodule.cpp2
-rw-r--r--src/quick/items/qquickwindowmodule_p.h2
-rw-r--r--src/quick/particles/qquickage.cpp2
-rw-r--r--src/quick/particles/qquickage_p.h2
-rw-r--r--src/quick/particles/qquickangledirection.cpp3
-rw-r--r--src/quick/particles/qquickangledirection_p.h2
-rw-r--r--src/quick/particles/qquickcumulativedirection.cpp2
-rw-r--r--src/quick/particles/qquickcumulativedirection_p.h2
-rw-r--r--src/quick/particles/qquickcustomaffector.cpp2
-rw-r--r--src/quick/particles/qquickcustomaffector_p.h2
-rw-r--r--src/quick/particles/qquickdirection.cpp2
-rw-r--r--src/quick/particles/qquickdirection_p.h2
-rw-r--r--src/quick/particles/qquickellipseextruder.cpp3
-rw-r--r--src/quick/particles/qquickellipseextruder_p.h2
-rw-r--r--src/quick/particles/qquickfriction.cpp2
-rw-r--r--src/quick/particles/qquickfriction_p.h2
-rw-r--r--src/quick/particles/qquickgravity.cpp2
-rw-r--r--src/quick/particles/qquickgravity_p.h2
-rw-r--r--src/quick/particles/qquickgroupgoal.cpp2
-rw-r--r--src/quick/particles/qquickgroupgoal_p.h2
-rw-r--r--src/quick/particles/qquickimageparticle.cpp9
-rw-r--r--src/quick/particles/qquickimageparticle_p.h2
-rw-r--r--src/quick/particles/qquickitemparticle.cpp2
-rw-r--r--src/quick/particles/qquickitemparticle_p.h2
-rw-r--r--src/quick/particles/qquicklineextruder.cpp3
-rw-r--r--src/quick/particles/qquicklineextruder_p.h2
-rw-r--r--src/quick/particles/qquickmaskextruder.cpp2
-rw-r--r--src/quick/particles/qquickmaskextruder_p.h2
-rw-r--r--src/quick/particles/qquickparticleaffector.cpp2
-rw-r--r--src/quick/particles/qquickparticleaffector_p.h2
-rw-r--r--src/quick/particles/qquickparticleemitter.cpp2
-rw-r--r--src/quick/particles/qquickparticleemitter_p.h2
-rw-r--r--src/quick/particles/qquickparticleextruder.cpp3
-rw-r--r--src/quick/particles/qquickparticleextruder_p.h2
-rw-r--r--src/quick/particles/qquickparticlegroup.cpp2
-rw-r--r--src/quick/particles/qquickparticlegroup_p.h2
-rw-r--r--src/quick/particles/qquickparticlepainter.cpp2
-rw-r--r--src/quick/particles/qquickparticlepainter_p.h2
-rw-r--r--src/quick/particles/qquickparticlesmodule.cpp2
-rw-r--r--src/quick/particles/qquickparticlesmodule_p.h2
-rw-r--r--src/quick/particles/qquickparticlesystem.cpp2
-rw-r--r--src/quick/particles/qquickparticlesystem_p.h2
-rw-r--r--src/quick/particles/qquickpointattractor.cpp2
-rw-r--r--src/quick/particles/qquickpointattractor_p.h2
-rw-r--r--src/quick/particles/qquickpointdirection.cpp3
-rw-r--r--src/quick/particles/qquickpointdirection_p.h2
-rw-r--r--src/quick/particles/qquickrectangleextruder.cpp3
-rw-r--r--src/quick/particles/qquickrectangleextruder_p.h2
-rw-r--r--src/quick/particles/qquickspritegoal.cpp2
-rw-r--r--src/quick/particles/qquickspritegoal_p.h2
-rw-r--r--src/quick/particles/qquicktargetdirection.cpp2
-rw-r--r--src/quick/particles/qquicktargetdirection_p.h2
-rw-r--r--src/quick/particles/qquicktrailemitter.cpp2
-rw-r--r--src/quick/particles/qquicktrailemitter_p.h2
-rw-r--r--src/quick/particles/qquickturbulence.cpp2
-rw-r--r--src/quick/particles/qquickturbulence_p.h2
-rw-r--r--src/quick/particles/qquickv8particledata.cpp2
-rw-r--r--src/quick/particles/qquickv8particledata_p.h2
-rw-r--r--src/quick/particles/qquickwander.cpp2
-rw-r--r--src/quick/particles/qquickwander_p.h2
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp6
-rw-r--r--src/quick/scenegraph/coreapi/qsgrendernode.cpp2
-rw-r--r--src/quick/scenegraph/coreapi/qsgrendernode_p.h2
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp1
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp2
-rw-r--r--src/quick/scenegraph/qsgcontextplugin.cpp15
-rw-r--r--src/quick/scenegraph/qsgcontextplugin_p.h2
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp1
-rw-r--r--src/quick/scenegraph/qsgdefaultrectanglenode.cpp3
-rw-r--r--src/quick/scenegraph/qsgdefaultrectanglenode_p.h4
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp6
-rw-r--r--src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp39
-rw-r--r--src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h2
-rw-r--r--src/quick/scenegraph/scenegraph.pri2
-rw-r--r--src/quick/scenegraph/util/qsgdistancefieldutil.cpp714
-rw-r--r--src/quick/scenegraph/util/qsgdistancefieldutil_p.h24
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp3
-rw-r--r--src/quick/util/qquickanimationcontroller_p.h2
-rw-r--r--src/quick/util/qquickpixmapcache.cpp10
-rw-r--r--src/quick/util/qquickstyledtext.cpp43
-rw-r--r--src/quick/util/qquickstyledtext_p.h6
-rw-r--r--tests/auto/host.pro9
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro2
-rw-r--r--tests/auto/qml/debugger/qv8profilerservice/tst_qv8profilerservice.cpp14
-rw-r--r--tests/auto/qml/qml.pro1
-rw-r--r--tests/auto/qml/qmlmin/tst_qmlmin.cpp3
-rw-r--r--tests/auto/qml/qqmlcomponent/data/createParentReference.qml12
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp32
-rw-r--r--tests/auto/qml/qqmlecmascript/data/jsimport/importModuleApi.js5
-rw-r--r--tests/auto/qml/qqmlecmascript/data/jsimport/testImportModuleApi.qml10
-rw-r--r--tests/auto/qml/qqmlecmascript/data/rewriteMultiLineStrings_crlf.1.qml13
-rw-r--r--tests/auto/qml/qqmlecmascript/data/signalAssignment.3.qml5
-rw-r--r--tests/auto/qml/qqmlecmascript/data/signalAssignment.4.qml6
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h2
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp51
-rw-r--r--tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/data/signal.5.errors.txt1
-rw-r--r--tests/auto/qml/qqmllanguage/data/signal.5.qml6
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.h3
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp1
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp38
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/method.1.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/method.2.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/method.3.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.MyQmlObject.qml6
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.QtObject.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.alias.2.qml6
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.alias.3.qml7
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.alias.qml7
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.bool.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.color.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.date.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.int.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.list.MyQmlObject.qml6
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.list.QtObject.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.real.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.string.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.url.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.var.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/property.variant.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/signal.1.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/signal.2.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/signal.3.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/signal.4.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/data/signal.5.qml5
-rw-r--r--tests/auto/qml/qqmlmetaobject/qqmlmetaobject.pro14
-rw-r--r--tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp364
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/empty.json1
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2.1/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin.2/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/plugin/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/pluginMixed/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/pluginVersion/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/pluginWithQmlFile/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/pluginWrongCase/plugin.cpp4
-rw-r--r--tests/auto/qml/qqmlvaluetypes/data/nonValueTypeComparison.qml10
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp17
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp4
-rw-r--r--tests/auto/qml/v4/data/colorType.qml18
-rw-r--r--tests/auto/qml/v4/tst_v4.cpp18
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp28
-rw-r--r--tests/auto/quick/qquickanchors/data/stretch.qml39
-rw-r--r--tests/auto/quick/qquickanchors/tst_qquickanchors.cpp41
-rw-r--r--tests/auto/quick/qquickanimatedsprite/data/basic.qml58
-rw-r--r--tests/auto/quick/qquickanimatedsprite/data/squarefacesprite.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/quick/qquickanimatedsprite/qquickanimatedsprite.pro15
-rw-r--r--tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp83
-rw-r--r--tests/auto/quick/qquickanimations/tst_qquickanimations.cpp19
-rw-r--r--tests/auto/quick/qquickdroparea/qquickdroparea.pro2
-rw-r--r--tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp75
-rw-r--r--tests/auto/quick/qquickgridview/data/displacedTransitions.qml138
-rw-r--r--tests/auto/quick/qquickgridview/data/multipleTransitions.qml28
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp249
-rw-r--r--tests/auto/quick/qquicklistview/data/displacedTransitions.qml128
-rw-r--r--tests/auto/quick/qquicklistview/data/multipleTransitions.qml29
-rw-r--r--tests/auto/quick/qquicklistview/data/sectionpropertychange.qml92
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp323
-rw-r--r--tests/auto/quick/qquickpositioners/data/transitions.qml196
-rw-r--r--tests/auto/quick/qquickpositioners/qquickpositioners.pro1
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp455
-rw-r--r--tests/auto/quick/qquickspritesequence/data/advance.qml66
-rw-r--r--tests/auto/quick/qquickspritesequence/data/basic.qml60
-rw-r--r--tests/auto/quick/qquickspritesequence/data/squarefacesprite.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/quick/qquickspritesequence/qquickspritesequence.pro15
-rw-r--r--tests/auto/quick/qquickspritesequence/tst_qquickspritesequence.cpp98
-rw-r--r--tests/auto/quick/qquickstyledtext/tst_qquickstyledtext.cpp130
-rw-r--r--tests/auto/quick/qquicktext/data/fontSizeMode.qml2
-rw-r--r--tests/auto/quick/qquicktext/data/multilengthStrings.qml2
-rw-r--r--tests/auto/quick/qquicktext/data/multilengthStringsWrapped.qml2
-rw-r--r--tests/auto/quick/qquicktext/data/multilineelide.qml2
-rw-r--r--tests/auto/quick/qquicktext/data/pixelFontSizes.qml21
-rw-r--r--tests/auto/quick/qquicktext/data/pointFontSizes.qml21
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp620
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp41
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp77
-rw-r--r--tests/auto/quick/quick.pro13
-rw-r--r--tests/auto/quick/shared/viewtestutil.h2
-rw-r--r--tests/benchmarks/qml/script/data/enums.qml2
-rw-r--r--tests/benchmarks/qml/script/data/namespacedEnums.qml2
-rw-r--r--tests/benchmarks/qml/script/data/scriptCall.qml2
-rw-r--r--tests/benchmarks/qml/script/data/signal_heavyArgsAccess.qml51
-rw-r--r--tests/benchmarks/qml/script/data/signal_heavyIdAccess.qml54
-rw-r--r--tests/benchmarks/qml/script/script.pro3
-rw-r--r--tests/benchmarks/qml/script/tst_script.cpp253
-rw-r--r--tools/qmlplugindump/main.cpp2
-rw-r--r--tools/qmlprofiler/profileclient.cpp16
-rw-r--r--tools/qmlprofiler/profileclient.h8
-rw-r--r--tools/qmlprofiler/profiledata.cpp188
-rw-r--r--tools/qmlprofiler/profiledata.h34
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.cpp54
-rw-r--r--tools/qmlprofiler/qmlprofilerapplication.h6
1107 files changed, 51141 insertions, 4207 deletions
diff --git a/.gitattributes b/.gitattributes
index a3c6108370..157176bdb8 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,2 @@
.tag ident
+*_crlf.* eol=crlf
diff --git a/.gitignore b/.gitignore
index e1bf85aa29..4c8776bc5d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,20 +1,6 @@
# This file is used to ignore files which are generated in the Qt build system
# ----------------------------------------------------------------------------
-examples/*/*/*
-!examples/*/*/*[.]*
-!examples/*/*/README
-examples/*/*/*[.]app
-!examples/declarative/*
-!examples/tutorials/*
-!examples/tutorials/*/*
-!examples/ja_JP/*/*
-demos/*/*
-!demos/spectrum/*
-demos/spectrum/bin
-!demos/*/*[.]*
-demos/*/*[.]app
-!demos/declarative/*
config.tests/*/*/*
!config.tests/*/*/*[.]*
config.tests/*/*/*[.]app
@@ -273,4 +259,4 @@ tests/auto/*/*.o
tests/auto/*/*.moc
tests/auto/*/*/*.o
tests/auto/*/*/*.moc
-src/declarative/generated/ \ No newline at end of file
+src/declarative/generated/
diff --git a/bin/rename-qtdeclarative-symbols.sh b/bin/rename-qtdeclarative-symbols.sh
index 841850230f..0d521dd5a8 100755
--- a/bin/rename-qtdeclarative-symbols.sh
+++ b/bin/rename-qtdeclarative-symbols.sh
@@ -75,6 +75,7 @@ QML_SYMBOLS="\
QDeclarativeCompiledData
QDeclarativeCompiler
QDeclarativeCompilerTypes
+ QDeclarativeCompilingProfiler
QDeclarativeComponent
QDeclarativeComponentAttached
QDeclarativeComponentExtension
@@ -152,6 +153,7 @@ QML_SYMBOLS="\
QDeclarativeGuard
QDeclarativeGuardedContextData
QDeclarativeGuardImpl
+ QDeclarativeHandlingSignalProfiler
QDeclarativeImageProvider
QDeclarativeImageProviderPrivate
QDeclarativeImportDatabase
@@ -189,6 +191,7 @@ QML_SYMBOLS="\
QDeclarativeNotifierEndpoint
QDeclarativeNullableValue
QDeclarativeNumberExtension
+ QDeclarativeObjectCreatingProfiler
QDeclarativeObjectData
QDeclarativeObjectProperty
QDeclarativeObserverMode
diff --git a/doc/config/qtquick.qdocconf b/doc/config/qtquick.qdocconf
index 69e860919e..3f4645aeaa 100644
--- a/doc/config/qtquick.qdocconf
+++ b/doc/config/qtquick.qdocconf
@@ -19,7 +19,8 @@ headerdirs += ../src \
imagedirs += ../src/images \
sourcedirs += ../src \
- ../../src
+ ../../src \
+ ../../examples
#indexes = $QT5DOC/doc/html/qt.index
diff --git a/doc/src/examples/examples-groups.qdoc b/doc/src/examples/examples-groups.qdoc
index 9a6dafa435..0ecd117128 100644
--- a/doc/src/examples/examples-groups.qdoc
+++ b/doc/src/examples/examples-groups.qdoc
@@ -32,15 +32,6 @@
\brief This is an internationalization example
*/
/*!
- \title QML Examples - Shader Effects
- \example declarative/shadereffects
- \image qml-shadereffects-example.png
- \brief This is a shader effects example
-
- This example demonstrates a couple of visual effects that you can perform
- with shaders in QtQuick 2.0
-*/
-/*!
\title QML Examples - Positioners
\example declarative/positioners
\brief This is a positioners example
@@ -49,26 +40,6 @@
This example demonstrates the positioners and some of their animations.
*/
/*!
- \title QML Examples - Animation
- \example declarative/animation
- \brief This is a collection of QML examples
- \image qml-animations-example.png
-
- This is a collection of small QML examples relating to animation. Each example is
- a small QML file, usually containing or emphasizing a particular element or
- feature. You can run and observe the behavior of each example.
-*/
-/*!
- \title QML Examples - Image Elements
- \example declarative/imageelements
- \brief This is a collection of QML examples
- \image qml-imageelements-example.png
-
- This is a collection of small QML examples relating to image elements. Each example is
- a small QML file, usually containing or emphasizing a particular element or
- feature. You can run and observe the behavior of each example.
-*/
-/*!
\title QML Examples - Models and Views
\example declarative/modelviews
\brief This is a collection of QML examples
diff --git a/doc/src/examples/examples-toys.qdoc b/doc/src/examples/examples-toys.qdoc
index f076c1de6c..7414579e19 100644
--- a/doc/src/examples/examples-toys.qdoc
+++ b/doc/src/examples/examples-toys.qdoc
@@ -27,13 +27,6 @@
/*!
- \title QML Example - Calculator
- \example declarative/calculator
- \brief This is an example application written in QML.
- \image qml-calculator-demo-small.png
-*/
-
-/*!
\title QML Example - Samegame
\example declarative/samegame
\brief This example demonstrates creating a game with javascript game logic.
diff --git a/doc/src/localstorage/localstorage.qdoc b/doc/src/localstorage/localstorage.qdoc
index 406de25339..5287120e86 100644
--- a/doc/src/localstorage/localstorage.qdoc
+++ b/doc/src/localstorage/localstorage.qdoc
@@ -33,9 +33,24 @@ The local storage API provides a JavaScript interface to an SQL relational
database. The QtQuick.LocalStorage module contains the API and it may be given
a namespace.
+Import QtQuick.LocalStorage module from QML:
\code
-import QtQuick.LocalStorage 2.0 as SQL
+//sql.qml
+
+import QtQuick.LocalStorage 2.0 as Sql
+\endcode
+
+
+Import QtQuick.LocalStorage module from JavaScript:
+\code
+//sql.js
+.import QtQuick.LocalStorage 2.0 as Sql
\endcode
+
+Note, importing a module from JavaScript is different from importing from QML.
+The \l{JavaScript Code} article contains detailed information on importing in JavaScript code.
+
+
\section2 Database API
The \c openDatabaseSync() and related functions
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-basic.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-basic.qml
index 8a05491ee1..cb94acb2b1 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-basic.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-basic.qml
@@ -60,7 +60,7 @@ ListView {
NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
}
- addDisplaced: Transition {
+ displaced: Transition {
NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBounce }
}
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml
index 79d00d2d1c..84c4848a76 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-delayedbyindex.qml
@@ -60,12 +60,12 @@ ListView {
}
//! [0]
- addDisplaced: Transition {
- id: addDispTrans
+ displaced: Transition {
+ id: dispTrans
SequentialAnimation {
PauseAnimation {
- duration: (addDispTrans.ViewTransition.index -
- addDispTrans.ViewTransition.targetIndexes[0]) * 100
+ duration: (dispTrans.ViewTransition.index -
+ dispTrans.ViewTransition.targetIndexes[0]) * 100
}
NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBounce }
}
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml
index a43d3a8b7f..89353b40e8 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-intermediatemove.qml
@@ -60,20 +60,20 @@ ListView {
}
//! [0]
- addDisplaced: Transition {
- id: addDispTrans
+ displaced: Transition {
+ id: dispTrans
SequentialAnimation {
PauseAnimation {
- duration: (addDispTrans.ViewTransition.index -
- addDispTrans.ViewTransition.targetIndexes[0]) * 100
+ duration: (dispTrans.ViewTransition.index -
+ dispTrans.ViewTransition.targetIndexes[0]) * 100
}
ParallelAnimation {
NumberAnimation {
- property: "x"; to: addDispTrans.ViewTransition.item.x + 20
+ property: "x"; to: dispTrans.ViewTransition.item.x + 20
easing.type: Easing.OutQuad
}
NumberAnimation {
- property: "y"; to: addDispTrans.ViewTransition.item.y + 50
+ property: "y"; to: dispTrans.ViewTransition.item.y + 50
easing.type: Easing.OutQuad
}
}
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml
index 1355268710..0644caaec7 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-interruptedgood.qml
@@ -60,7 +60,7 @@ ListView {
}
//! [0]
- addDisplaced: Transition {
+ displaced: Transition {
NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBounce }
// ensure opacity and scale values return to 1.0
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-pathanim.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-pathanim.qml
index 3d075c4367..4b1685719d 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-pathanim.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-pathanim.qml
@@ -76,20 +76,20 @@ ListView {
}
//! [0]
- addDisplaced: Transition {
- id: addDispTrans
+ displaced: Transition {
+ id: dispTrans
SequentialAnimation {
PauseAnimation {
- duration: (addDispTrans.ViewTransition.index -
- addDispTrans.ViewTransition.targetIndexes[0]) * 100
+ duration: (dispTrans.ViewTransition.index -
+ dispTrans.ViewTransition.targetIndexes[0]) * 100
}
ParallelAnimation {
NumberAnimation {
- property: "x"; to: addDispTrans.ViewTransition.item.x + 20
+ property: "x"; to: dispTrans.ViewTransition.item.x + 20
easing.type: Easing.OutQuad
}
NumberAnimation {
- property: "y"; to: addDispTrans.ViewTransition.item.y + 50
+ property: "y"; to: dispTrans.ViewTransition.item.y + 50
easing.type: Easing.OutQuad
}
}
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml
index 03348356e1..0e7d1e8d82 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactionbad.qml
@@ -70,7 +70,7 @@ ListView {
}
}
- moveDisplaced: Transition {
+ displaced: Transition {
NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBounce }
}
diff --git a/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml b/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml
index eda5c35479..7fa7e48f82 100644
--- a/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml
+++ b/doc/src/snippets/qml/viewtransitions/viewtransitions-scriptactiongood.qml
@@ -73,7 +73,7 @@ ListView {
}
//! [0]
- moveDisplaced: Transition {
+ displaced: Transition {
NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBounce }
}
diff --git a/doc/src/whatsnew.qdoc b/doc/src/whatsnew.qdoc
index bf77e0e6c0..c791e72c25 100644
--- a/doc/src/whatsnew.qdoc
+++ b/doc/src/whatsnew.qdoc
@@ -112,8 +112,11 @@ Setting Image sourceSize.width and sourceSize.height will now fit the image to t
Grid now has rowSpacing and columnSpacing properties. Spacing properties on positioners are now real numbers instead
of integers.
-Positioners now have attached properties that can be used to determine a subitem's location within a
-container such as Column or Row: Positioner.index, Positioner.isFirstItem, Positioner.isLastItem.
+Positioner (Row, Column, Grid, Flow) improvements:
+\list
+\o Transitions used for \c add and \c move now have improved features: they can access a ViewTransition attached property (see the ViewTransition documentation for examples) and can now animate arbitrary item properties (instead of being restricted to animating an item's position).
+\o Items in a positioner now have attached properties that can be used to determine a subitem's location: Positioner.index, Positioner.isFirstItem, Positioner.isLastItem.
+\endlist
Loader improvements:
- "active" property added to Loader, to allow delaying instantiation of a Loader element's item property
diff --git a/examples/HACKING b/examples/HACKING
new file mode 100644
index 0000000000..9539d2d129
--- /dev/null
+++ b/examples/HACKING
@@ -0,0 +1,23 @@
+Some guidelines for QtQml examples
+
+Snippets
+---
+Snippets are snatches of QML code that won't even run on their own. They don't belong here, they belong in doc/src/snippets. They should be contained in files that will compile on their own, for automated syntax validation, but don't have to look like anything.
+
+Examples
+---
+
+Examples are large blocks of QML code that demonstrate a feature. You should be able to launch an example and visually see the feature take effect. Examples should be written in a small form, and should automatically activate any features. Ideally, when you run an example, you see the feature demonstrate itself over and over until you get bored and close the application using your platform's close window mechanism. Examples shouldn't contain their own close buttons or start screen, explanatory text should be kept to a minimum (show, not tell), and reserve interaction for demonstrating interactive elements. The code should be held to a high level of quality, and should be understandable by people new to QML.
+
+Unless the demonstrated feature uses it, assume no interface devices other than a screen that can show a 320x480 rectangle and a generic pointing device (with the shared subset of mouse/touch functionality).
+
+Groups of similar examples should be placed in one folder with a single launcher application, which uses the shared folder of common components.
+
+The example, or launcher application in case of groups, should contain a qdoc comment explaining the example. The example or launcher should be buildable as a full C++ application and runnable with the standard qml file launcher. Usually this will consist primarily of using the macro found in shared.h.
+
+Demos
+---
+
+Demos are examples of creating full applications using QML. They should fit both a desktop and a mobile form factor, they should have their own start screen and method of exiting the application. They should be at a level of quality that you'd be comfortable submitting them to an app store for a platform of the appropriate hardware (screen size, input methods, etc.). The code should be written to a level that is easily understood and modified by a QML expert.
+
+Demos should have a qdoc file in their directory explaining the demo at a high level. The demo should be buildable as a full C++ application and preferably runnable with the standard qml file launcher.
diff --git a/examples/README b/examples/README
new file mode 100644
index 0000000000..aba1e2cc0d
--- /dev/null
+++ b/examples/README
@@ -0,0 +1,12 @@
+The Qt Declarative module provides the ability to specify and implement
+your user interface declaratively, using the Qt Meta-Object Language (QML). This
+language is very expressive and human readable, and can be used by
+designers to actually implement their UI vision. QML UIs can integrate
+with C++ code in many ways, including being loaded as a part of a C++ UI
+and loading data models from C++ and interacting with them.
+
+Mostof these examples can be viewed directly with the
+QML viewer utility, without requiring compilation.
+
+Documentation for these examples can be found via the Examples
+link in the main Qt documentation.
diff --git a/examples/demos/calculator/CalculatorCore/Button.qml b/examples/demos/calculator/CalculatorCore/Button.qml
new file mode 100644
index 0000000000..e7b3637b4c
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/Button.qml
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+BorderImage {
+ id: button
+
+ property alias operation: buttonText.text
+ property string color: ""
+
+ Accessible.name: operation
+ Accessible.description: "This button does " + operation
+ Accessible.role: Accessible.Button
+
+ signal clicked
+
+ source: "images/button-" + color + ".png"; clip: true
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+
+ Rectangle {
+ id: shade
+ anchors.fill: button; radius: 10; color: "black"; opacity: 0
+ }
+
+ Text {
+ id: buttonText
+ anchors.centerIn: parent; anchors.verticalCenterOffset: -1
+ font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5
+ style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ window.doOp(operation)
+ button.clicked()
+ }
+ }
+
+ states: State {
+ name: "pressed"; when: mouseArea.pressed == true
+ PropertyChanges { target: shade; opacity: .4 }
+ }
+}
diff --git a/examples/demos/calculator/CalculatorCore/Display.qml b/examples/demos/calculator/CalculatorCore/Display.qml
new file mode 100644
index 0000000000..3dceeab169
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/Display.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+BorderImage {
+ id: image
+
+ property alias text : displayText.text
+ property alias currentOperation : operationText
+
+ source: "images/display.png"
+ border { left: 10; top: 10; right: 10; bottom: 10 }
+
+ Text {
+ id: displayText
+ anchors {
+ right: parent.right; verticalCenter: parent.verticalCenter; verticalCenterOffset: -1
+ rightMargin: 6; left: operationText.right
+ }
+ font.pixelSize: parent.height * .6; text: "0"; horizontalAlignment: Text.AlignRight; elide: Text.ElideRight
+ color: "#343434"; smooth: true; font.bold: true
+ }
+ Text {
+ id: operationText
+ font.bold: true; font.pixelSize: parent.height * .7
+ color: "#343434"; smooth: true
+ anchors { left: parent.left; leftMargin: 6; verticalCenterOffset: -3; verticalCenter: parent.verticalCenter }
+ }
+}
diff --git a/examples/demos/calculator/CalculatorCore/calculator.js b/examples/demos/calculator/CalculatorCore/calculator.js
new file mode 100644
index 0000000000..e2b5692cf3
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/calculator.js
@@ -0,0 +1,95 @@
+
+var curVal = 0
+var memory = 0
+var lastOp = ""
+var timer = 0
+
+function disabled(op) {
+ if (op == "." && display.text.toString().search(/\./) != -1) {
+ return true
+ } else if (op == squareRoot && display.text.toString().search(/-/) != -1) {
+ return true
+ } else {
+ return false
+ }
+}
+
+function doOperation(op) {
+ if (op == '*')//Keyboard Aliases
+ op = multiplication;
+ if (op == '/')
+ op = division;
+ if (disabled(op)) {
+ return
+ }
+
+ if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) {
+ if (display.text.toString().length >= 14)
+ return; // No arbitrary length numbers
+ if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) {
+ display.text = display.text + op.toString()
+ } else {
+ display.text = op
+ }
+ lastOp = op
+ return
+ }
+ lastOp = op
+
+ if (display.currentOperation.text == "+") {
+ display.text = Number(display.text.valueOf()) + Number(curVal.valueOf())
+ } else if (display.currentOperation.text == "-") {
+ display.text = Number(curVal) - Number(display.text.valueOf())
+ } else if (display.currentOperation.text == multiplication) {
+ display.text = Number(curVal) * Number(display.text.valueOf())
+ } else if (display.currentOperation.text == division) {
+ display.text = Number(Number(curVal) / Number(display.text.valueOf())).toString()
+ } else if (display.currentOperation.text == "=") {
+ }
+
+ if (op == "+" || op == "-" || op == multiplication || op == division) {
+ display.currentOperation.text = op
+ curVal = display.text.valueOf()
+ return
+ }
+
+ curVal = 0
+ display.currentOperation.text = ""
+
+ if (op == "1/x") {
+ display.text = (1 / display.text.valueOf()).toString()
+ } else if (op == "x^2") {
+ display.text = (display.text.valueOf() * display.text.valueOf()).toString()
+ } else if (op == "Abs") {
+ display.text = (Math.abs(display.text.valueOf())).toString()
+ } else if (op == "Int") {
+ display.text = (Math.floor(display.text.valueOf())).toString()
+ } else if (op == plusminus) {
+ display.text = (display.text.valueOf() * -1).toString()
+ } else if (op == squareRoot) {
+ display.text = (Math.sqrt(display.text.valueOf())).toString()
+ } else if (op == "mc") {
+ memory = 0;
+ } else if (op == "m+") {
+ memory += display.text.valueOf()
+ } else if (op == "mr") {
+ display.text = memory.toString()
+ } else if (op == "m-") {
+ memory = display.text.valueOf()
+ } else if (op == leftArrow) {
+ display.text = display.text.toString().slice(0, -1)
+ if (display.text.length == 0) {
+ display.text = "0"
+ }
+ } else if (op == "Off") {
+ Qt.quit();
+ } else if (op == "C") {
+ display.text = "0"
+ } else if (op == "AC") {
+ curVal = 0
+ memory = 0
+ lastOp = ""
+ display.text ="0"
+ }
+}
+
diff --git a/examples/demos/calculator/CalculatorCore/images/button-.png b/examples/demos/calculator/CalculatorCore/images/button-.png
new file mode 100644
index 0000000000..544e514536
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/images/button-.png
Binary files differ
diff --git a/examples/demos/calculator/CalculatorCore/images/button-blue.png b/examples/demos/calculator/CalculatorCore/images/button-blue.png
new file mode 100644
index 0000000000..5f92de32d0
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/images/button-blue.png
Binary files differ
diff --git a/examples/demos/calculator/CalculatorCore/images/button-green.png b/examples/demos/calculator/CalculatorCore/images/button-green.png
new file mode 100644
index 0000000000..36c93914c7
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/images/button-green.png
Binary files differ
diff --git a/examples/demos/calculator/CalculatorCore/images/button-purple.png b/examples/demos/calculator/CalculatorCore/images/button-purple.png
new file mode 100644
index 0000000000..347cbbea9d
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/images/button-purple.png
Binary files differ
diff --git a/examples/demos/calculator/CalculatorCore/images/button-red.png b/examples/demos/calculator/CalculatorCore/images/button-red.png
new file mode 100644
index 0000000000..3b335891ae
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/images/button-red.png
Binary files differ
diff --git a/examples/demos/calculator/CalculatorCore/images/display.png b/examples/demos/calculator/CalculatorCore/images/display.png
new file mode 100644
index 0000000000..9507f4382e
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/images/display.png
Binary files differ
diff --git a/examples/demos/calculator/CalculatorCore/qmldir b/examples/demos/calculator/CalculatorCore/qmldir
new file mode 100644
index 0000000000..a926b93fac
--- /dev/null
+++ b/examples/demos/calculator/CalculatorCore/qmldir
@@ -0,0 +1,2 @@
+Button Button.qml
+Display Display.qml
diff --git a/examples/demos/calculator/calculator-desktop.qml b/examples/demos/calculator/calculator-desktop.qml
new file mode 100644
index 0000000000..be65c77170
--- /dev/null
+++ b/examples/demos/calculator/calculator-desktop.qml
@@ -0,0 +1,136 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.0
+import "CalculatorCore"
+import "CalculatorCore/calculator.js" as CalcEngine
+
+Rectangle {
+ id: window
+
+ width: 640; height: 480
+ color: "#282828"
+
+ property string rotateLeft: "\u2939"
+ property string rotateRight: "\u2935"
+ property string leftArrow: "\u2190"
+ property string division : "\u00f7"
+ property string multiplication : "\u00d7"
+ property string squareRoot : "\u221a"
+ property string plusminus : "\u00b1"
+
+ function doOp(operation) { CalcEngine.doOperation(operation) }
+ focus: true
+ Keys.onPressed: doOp(event.text);
+
+ Item {
+ id: main
+ width: 640
+ height: 480
+ anchors.centerIn: parent
+
+ Column {
+ id: box; spacing: 8
+
+ anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 }
+
+ Display {
+ id: display
+ width: box.width-3
+ height: 64
+ }
+
+ Column {
+ id: column; spacing: 6
+
+ property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6)
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
+
+ Row {
+ spacing: 6
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" }
+ }
+
+ Row {
+ spacing: 6
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
+
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mc" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m+" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m-" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mr" }
+ }
+
+ Grid {
+ id: grid; rows: 5; columns: 5; spacing: 6
+
+ property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns)
+
+ Button { width: grid.w; height: column.h; operation: "7"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "8"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "9"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: division }
+ Button { width: grid.w; height: column.h; operation: squareRoot }
+ Button { width: grid.w; height: column.h; operation: "4"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "5"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "6"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: multiplication }
+ Button { width: grid.w; height: column.h; operation: "x^2" }
+ Button { width: grid.w; height: column.h; operation: "1"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "2"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "3"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "-" }
+ Button { width: grid.w; height: column.h; operation: "1/x" }
+ Button { width: grid.w; height: column.h; operation: "0"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "." }
+ Button { width: grid.w; height: column.h; operation: plusminus }
+ Button { width: grid.w; height: column.h; operation: "+" }
+ Button { width: grid.w; height: column.h; operation: "="; color: 'red' }
+ }
+ }
+ }
+
+ }
+}
diff --git a/examples/demos/calculator/calculator-mobile.qml b/examples/demos/calculator/calculator-mobile.qml
new file mode 100644
index 0000000000..7ee622f698
--- /dev/null
+++ b/examples/demos/calculator/calculator-mobile.qml
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.0
+import "CalculatorCore"
+import "CalculatorCore/calculator.js" as CalcEngine
+
+Rectangle {
+ id: window
+
+ width: 320; height: 480
+ color: "#282828"
+
+ property string rotateLeft: "\u2939"
+ property string rotateRight: "\u2935"
+ property string leftArrow: "\u2190"
+ property string division : "\u00f7"
+ property string multiplication : "\u00d7"
+ property string squareRoot : "\u221a"
+ property string plusminus : "\u00b1"
+
+ function doOp(operation) { CalcEngine.doOperation(operation) }
+
+ Item {
+ id: main
+ state: "orientation " + Screen.orientation
+
+ //Note: Assumes a primarily portrait device
+ property bool landscapeWindow: window.width > window.height
+ property real baseWidth: landscapeWindow ? window.height : window.width
+ property real baseHeight: landscapeWindow ? window.width : window.height
+ property real rotationDelta: landscapeWindow ? -90 : 0
+
+ rotation: rotationDelta
+ width: main.baseWidth
+ height: main.baseHeight
+ anchors.centerIn: parent
+
+ Column {
+ id: box; spacing: 8
+
+ anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 }
+
+ Display {
+ id: display
+ width: box.width-3
+ height: 64
+ }
+
+ Column {
+ id: column; spacing: 6
+
+ property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6)
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
+
+ Row {
+ spacing: 6
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "C" }
+ Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" }
+ }
+
+ Row {
+ spacing: 6
+ property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4)
+
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mc" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m+" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "m-" }
+ Button { width: column.w; height: column.h; color: 'green'; operation: "mr" }
+ }
+
+ Grid {
+ id: grid; rows: 5; columns: 5; spacing: 6
+
+ property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns)
+
+ Button { width: grid.w; height: column.h; operation: "7"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "8"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "9"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: division }
+ Button { width: grid.w; height: column.h; operation: squareRoot }
+ Button { width: grid.w; height: column.h; operation: "4"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "5"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "6"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: multiplication }
+ Button { width: grid.w; height: column.h; operation: "x^2" }
+ Button { width: grid.w; height: column.h; operation: "1"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "2"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "3"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "-" }
+ Button { width: grid.w; height: column.h; operation: "1/x" }
+ Button { width: grid.w; height: column.h; operation: "0"; color: 'blue' }
+ Button { width: grid.w; height: column.h; operation: "." }
+ Button { width: grid.w; height: column.h; operation: plusminus }
+ Button { width: grid.w; height: column.h; operation: "+" }
+ Button { width: grid.w; height: column.h; operation: "="; color: 'red' }
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: "orientation " + Qt.LandscapeOrientation
+ PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
+ },
+ State {
+ name: "orientation " + Qt.InvertedPortraitOrientation
+ PropertyChanges { target: main; rotation: 180 + rotationDelta; }
+ },
+ State {
+ name: "orientation " + Qt.InvertedLandscapeOrientation
+ PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth }
+ }
+ ]
+
+ transitions: Transition {
+ SequentialAnimation {
+ RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint }
+ NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint }
+ }
+ }
+ }
+}
diff --git a/examples/demos/calculator/calculator.pro b/examples/demos/calculator/calculator.pro
new file mode 100644
index 0000000000..297d5cfdbb
--- /dev/null
+++ b/examples/demos/calculator/calculator.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+
+QT += quick qml
+SOURCES += main.cpp
+
+target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/calculator
+qml.files = calculator-desktop.qml calculator-mobile.qml CalculatorCore
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/calculator
+INSTALLS += target qml
diff --git a/examples/demos/calculator/calculator.qdoc b/examples/demos/calculator/calculator.qdoc
new file mode 100644
index 0000000000..e94bdb4cfd
--- /dev/null
+++ b/examples/demos/calculator/calculator.qdoc
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** GNU Free Documentation License
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms
+** and conditions contained in a signed written agreement between you
+** and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \title QML Demo - Calculator
+ \example declarative/calculator
+ \brief This is an example calculator application written in QML.
+ \image qml-calculator-demo-small.png
+
+ The Calculator demo implements a simple calculator in QML. It is written for desktop and portrait devices,
+ although on device it supports orientation changes.
+*/
+
diff --git a/examples/demos/calculator/main.cpp b/examples/demos/calculator/main.cpp
new file mode 100644
index 0000000000..fafe14fe46
--- /dev/null
+++ b/examples/demos/calculator/main.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** 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 <QGuiApplication>
+#include <QStringList>
+#include <QQuickView>
+#include <QQmlEngine>
+
+void usage()
+{
+ printf("Pass -desktop to use the Desktop UI");
+ exit(0);
+}
+
+int main(int argc, char* argv[])
+{
+ QGuiApplication app(argc,argv);
+ QQuickView view;
+ QUrl launchFile = QUrl::fromLocalFile(QLatin1String("calculator-mobile.qml"));
+ if (app.arguments().contains(QLatin1String("-help")))
+ usage();
+ if (app.arguments().contains(QLatin1String("-desktop")))
+ launchFile = QUrl::fromLocalFile(QLatin1String("calculator-desktop.qml"));
+ view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+ view.setSource(launchFile);
+ view.show();
+ return app.exec();
+}
+
diff --git a/examples/demos/clocks/clocks.qml b/examples/demos/clocks/clocks.qml
new file mode 100644
index 0000000000..288e50c9eb
--- /dev/null
+++ b/examples/demos/clocks/clocks.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** 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 "content"
+
+Rectangle {
+ id: root
+ width: 640; height: 320
+ color: "#646464"
+
+ ListView {
+ id: clockview
+ anchors.fill: parent
+ orientation: ListView.Horizontal
+ cacheBuffer: 2000
+ snapMode: ListView.SnapOneItem
+ highlightRangeMode: ListView.ApplyRange
+
+ delegate: Clock { city: cityName; shift: timeShift }
+ model: ListModel {
+ ListElement { cityName: "New York"; timeShift: -4 }
+ ListElement { cityName: "London"; timeShift: 0 }
+ ListElement { cityName: "Oslo"; timeShift: 1 }
+ ListElement { cityName: "Mumbai"; timeShift: 5.5 }
+ ListElement { cityName: "Tokyo"; timeShift: 9 }
+ ListElement { cityName: "Brisbane"; timeShift: 10 }
+ ListElement { cityName: "Los Angeles"; timeShift: -8 }
+ }
+ }
+
+ Image {
+ anchors.left: parent.left
+ anchors.bottom: parent.bottom
+ anchors.margins: 10
+ source: "content/arrow.png"
+ rotation: -90
+ opacity: clockview.atXBeginning ? 0 : 0.5
+ Behavior on opacity { NumberAnimation { duration: 500 } }
+ }
+
+ Image {
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: 10
+ source: "content/arrow.png"
+ rotation: 90
+ opacity: clockview.atXEnd ? 0 : 0.5
+ Behavior on opacity { NumberAnimation { duration: 500 } }
+ }
+}
diff --git a/examples/demos/clocks/content/Clock.qml b/examples/demos/clocks/content/Clock.qml
new file mode 100644
index 0000000000..7f0e8cba83
--- /dev/null
+++ b/examples/demos/clocks/content/Clock.qml
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** 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
+
+Item {
+ id : clock
+ width: {
+ if (ListView.view && ListView.view.width >= 200)
+ return ListView.view.width / Math.floor(ListView.view.width / 200.0);
+ else
+ return 200;
+ }
+
+ height: {
+ if (ListView.view && ListView.view.height >= 240)
+ return ListView.view.height;
+ else
+ return 240;
+ }
+
+ property alias city: cityLabel.text
+ property int hours
+ property int minutes
+ property int seconds
+ property real shift
+ property bool night: false
+ property bool internationalTime: true //Unset for local time
+
+ function timeChanged() {
+ var date = new Date;
+ hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours()
+ night = ( hours < 7 || hours > 19 )
+ minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes()
+ seconds = date.getUTCSeconds();
+ }
+
+ Timer {
+ interval: 100; running: true; repeat: true;
+ onTriggered: clock.timeChanged()
+ }
+
+ Item {
+ anchors.centerIn: parent
+ width: 200; height: 240
+
+ Image { id: background; source: "clock.png"; visible: clock.night == false }
+ Image { source: "clock-night.png"; visible: clock.night == true }
+
+
+ Image {
+ x: 92.5; y: 27
+ source: "hour.png"
+ smooth: true
+ transform: Rotation {
+ id: hourRotation
+ origin.x: 7.5; origin.y: 73;
+ angle: (clock.hours * 30) + (clock.minutes * 0.5)
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 93.5; y: 17
+ source: "minute.png"
+ smooth: true
+ transform: Rotation {
+ id: minuteRotation
+ origin.x: 6.5; origin.y: 83;
+ angle: clock.minutes * 6
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ x: 97.5; y: 20
+ source: "second.png"
+ smooth: true
+ transform: Rotation {
+ id: secondRotation
+ origin.x: 2.5; origin.y: 80;
+ angle: clock.seconds * 6
+ Behavior on angle {
+ SpringAnimation { spring: 2; damping: 0.2; modulus: 360 }
+ }
+ }
+ }
+
+ Image {
+ anchors.centerIn: background; source: "center.png"
+ }
+
+ Text {
+ id: cityLabel
+ y: 210; anchors.horizontalCenter: parent.horizontalCenter
+ color: "white"
+ font.family: "Helvetica"
+ font.bold: true; font.pixelSize: 16
+ style: Text.Raised; styleColor: "black"
+ }
+ }
+}
diff --git a/examples/demos/clocks/content/QuitButton.qml b/examples/demos/clocks/content/QuitButton.qml
new file mode 100644
index 0000000000..702b892d23
--- /dev/null
+++ b/examples/demos/clocks/content/QuitButton.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** 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
+Image {
+ source: "quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -10
+ onClicked: Qt.quit()
+ }
+}
diff --git a/examples/demos/clocks/content/arrow.png b/examples/demos/clocks/content/arrow.png
new file mode 100644
index 0000000000..e437312217
--- /dev/null
+++ b/examples/demos/clocks/content/arrow.png
Binary files differ
diff --git a/examples/demos/clocks/content/background.png b/examples/demos/clocks/content/background.png
new file mode 100644
index 0000000000..a885950862
--- /dev/null
+++ b/examples/demos/clocks/content/background.png
Binary files differ
diff --git a/examples/demos/clocks/content/center.png b/examples/demos/clocks/content/center.png
new file mode 100644
index 0000000000..7fbd802a44
--- /dev/null
+++ b/examples/demos/clocks/content/center.png
Binary files differ
diff --git a/examples/demos/clocks/content/clock-night.png b/examples/demos/clocks/content/clock-night.png
new file mode 100644
index 0000000000..cc7151a397
--- /dev/null
+++ b/examples/demos/clocks/content/clock-night.png
Binary files differ
diff --git a/examples/demos/clocks/content/clock.png b/examples/demos/clocks/content/clock.png
new file mode 100644
index 0000000000..462edacc0e
--- /dev/null
+++ b/examples/demos/clocks/content/clock.png
Binary files differ
diff --git a/examples/demos/clocks/content/hour.png b/examples/demos/clocks/content/hour.png
new file mode 100644
index 0000000000..f8061a1235
--- /dev/null
+++ b/examples/demos/clocks/content/hour.png
Binary files differ
diff --git a/examples/demos/clocks/content/minute.png b/examples/demos/clocks/content/minute.png
new file mode 100644
index 0000000000..1297ec7c2b
--- /dev/null
+++ b/examples/demos/clocks/content/minute.png
Binary files differ
diff --git a/examples/demos/clocks/content/quit.png b/examples/demos/clocks/content/quit.png
new file mode 100644
index 0000000000..b822057d4e
--- /dev/null
+++ b/examples/demos/clocks/content/quit.png
Binary files differ
diff --git a/examples/demos/clocks/content/second.png b/examples/demos/clocks/content/second.png
new file mode 100644
index 0000000000..4aa9fb5e8e
--- /dev/null
+++ b/examples/demos/clocks/content/second.png
Binary files differ
diff --git a/examples/demos/demos.pro b/examples/demos/demos.pro
new file mode 100644
index 0000000000..abe718b910
--- /dev/null
+++ b/examples/demos/demos.pro
@@ -0,0 +1,2 @@
+TEMPLATE = subdirs
+SUBDIRS = calculator
diff --git a/examples/demos/flickr/content/Button.qml b/examples/demos/flickr/content/Button.qml
new file mode 100644
index 0000000000..57f846aec3
--- /dev/null
+++ b/examples/demos/flickr/content/Button.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ signal clicked
+
+ property string text
+
+ BorderImage {
+ id: buttonImage
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ BorderImage {
+ id: pressed
+ opacity: 0
+ source: "images/toolbutton.sci"
+ width: container.width; height: container.height
+ }
+ MouseArea {
+ id: mouseRegion
+ anchors.fill: buttonImage
+ onClicked: { container.clicked(); }
+ }
+ Text {
+ color: "white"
+ anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 15
+ text: container.text; style: Text.Raised; styleColor: "black"
+ }
+ states: [
+ State {
+ name: "Pressed"
+ when: mouseRegion.pressed == true
+ PropertyChanges { target: pressed; opacity: 1 }
+ }
+ ]
+}
diff --git a/examples/demos/flickr/content/GridDelegate.qml b/examples/demos/flickr/content/GridDelegate.qml
new file mode 100644
index 0000000000..f8838bd609
--- /dev/null
+++ b/examples/demos/flickr/content/GridDelegate.qml
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: wrapper; width: GridView.view.cellWidth; height: GridView.view.cellHeight
+
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ scaleMe.state = "Details";
+ }
+
+ Item {
+ anchors.centerIn: parent
+ scale: 0.0
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
+ id: scaleMe
+
+ Item {
+ width: 77; height: 77; anchors.centerIn: parent
+ Rectangle {
+ id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true
+ Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true }
+ Image { source: "images/gloss.png" }
+ }
+ }
+
+ Connections {
+ target: toolBar
+ onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show'
+ }
+
+ states: [
+ State {
+ name: "Show"; when: thumb.status == Image.Ready
+ PropertyChanges { target: scaleMe; scale: 1 }
+ },
+ State {
+ name: "Details"
+ PropertyChanges { target: scaleMe; scale: 1 }
+ ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer }
+ PropertyChanges { target: background; state: "DetailedView" }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "Show"; to: "Details"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ },
+ Transition {
+ from: "Details"; to: "Show"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+ ]
+ }
+ MouseArea { anchors.fill: wrapper; onClicked: photoClicked() }
+}
+
diff --git a/examples/demos/flickr/content/ImageDetails.qml b/examples/demos/flickr/content/ImageDetails.qml
new file mode 100644
index 0000000000..42b5e845ea
--- /dev/null
+++ b/examples/demos/flickr/content/ImageDetails.qml
@@ -0,0 +1,323 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Flipable {
+ id: container
+
+ property alias frontContainer: containerFront
+ property string photoTitle: ""
+ property string photoTags: ""
+ property int photoWidth
+ property int photoHeight
+ property string photoType
+ property string photoAuthor
+ property string photoDate
+ property string photoUrl
+ property int rating: 2
+ property variant prevScale: 1.0
+
+ property int flipDuration: 1600
+
+ signal closed
+
+ transform: Rotation {
+ id: itemRotation
+ origin.x: container.width / 2;
+ axis.y: 1; axis.z: 0
+ }
+
+ front: Item {
+ id: containerFront; anchors.fill: container
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"; opacity: 0.4
+ }
+
+ Column {
+ spacing: 10
+ anchors {
+ left: parent.left; leftMargin: 10
+ right: parent.right; rightMargin: 10
+ top: parent.top; topMargin: 120
+ }
+ Text { font.bold: true; color: "white"; elide: Text.ElideRight; text: container.photoTitle; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Size: " + container.photoWidth + 'x' + container.photoHeight; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Type: " + container.photoType; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Author: " + container.photoAuthor; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: "Published: " + container.photoDate; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags == "" ? "" : "Tags: "; width: parent.width }
+ Text { color: "white"; elide: Text.ElideRight; text: container.photoTags; width: parent.width }
+ }
+ }
+
+ back: Item {
+ anchors.fill: container
+
+ Rectangle { anchors.fill: parent; color: "black"; opacity: 0.4 }
+
+ Progress {
+ anchors.centerIn: parent; width: 200; height: 22
+ progress: bigImage.progress; visible: bigImage.status != Image.Ready
+ }
+
+ Flickable {
+ id: flickable; anchors.fill: parent; clip: true
+ contentWidth: imageContainer.width; contentHeight: imageContainer.height
+
+ function updateMinimumScale() {
+ if (bigImage.status == Image.Ready && bigImage.width != 0) {
+ slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height);
+ if (bigImage.width * slider.value > flickable.width) {
+ var xoff = (flickable.width/2 + flickable.contentX) * slider.value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
+ }
+ if (bigImage.height * slider.value > flickable.height) {
+ var yoff = (flickable.height/2 + flickable.contentY) * slider.value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
+ }
+ prevScale = slider.value;
+ }
+ }
+
+ onWidthChanged: updateMinimumScale()
+ onHeightChanged: updateMinimumScale()
+
+ Item {
+ id: imageContainer
+ width: Math.max(bigImage.width * bigImage.scale, flickable.width);
+ height: Math.max(bigImage.height * bigImage.scale, flickable.height);
+ Image {
+ id: bigImage; source: container.photoUrl; scale: slider.value
+ anchors.centerIn: parent; smooth: !flickable.movingVertically
+ onStatusChanged : {
+ // Default scale shows the entire image.
+ if (bigImage.status == Image.Ready && bigImage.width != 0) {
+ slider.minimum = Math.min(flickable.width / bigImage.width, flickable.height / bigImage.height);
+ prevScale = Math.min(slider.minimum, 1);
+ slider.value = prevScale;
+ }
+ if (inBackState && bigImage.status == Image.Ready)
+ effectBox.imageInAnim();
+ }
+ property bool inBackState: false
+ onInBackStateChanged:{
+ if(inBackState && bigImage.status == Image.Ready)
+ effectBox.imageInAnim();
+ else if (!inBackState && bigImage.status == Image.Ready)
+ effectBox.imageOutAnim();
+ }
+ }
+ ShaderEffectSource{
+ id: pictureSource
+ sourceItem: bigImage
+ smooth: true
+ //Workaround: Doesn't work below lines
+ width: bigImage.width
+ height: bigImage.width
+ visible: false
+ }
+ Turbulence{//only fill visible rect
+ id: turbulence
+ system: imageSystem
+ anchors.fill: parent
+ strength: 240
+ enabled: false
+ }
+
+ Item{
+ id: effectBox
+ width: bigImage.width * bigImage.scale
+ height: bigImage.height * bigImage.scale
+ anchors.centerIn: parent
+ function imageInAnim(){
+ bigImage.visible = false;
+ noiseIn.visible = true;
+ endEffectTimer.start();
+ }
+ function imageOutAnim(){
+ bigImage.visible = false;
+ noiseIn.visible = false;
+ turbulence.enabled = true;
+ endEffectTimer.start();
+ pixelEmitter.burst(2048);
+ }
+ Timer{
+ id: endEffectTimer
+ interval: flipDuration
+ repeat: false
+ running: false
+ onTriggered:{
+ turbulence.enabled = false;
+ noiseIn.visible = false;
+ bigImage.visible = true;
+ }
+ }
+ ShaderEffect{
+ id: noiseIn
+ anchors.fill: parent
+ property real t: 0
+ visible: false
+ onVisibleChanged: tAnim.start()
+ NumberAnimation{
+ id: tAnim
+ target: noiseIn
+ property: "t"
+ from: 0.0
+ to: 1.0
+ duration: flipDuration
+ }
+ property variant source: pictureSource
+ property variant noise: ShaderEffectSource{
+ sourceItem:Image{
+ source: "images/noise.png"
+ }
+ hideSource: true
+ smooth: false
+ }
+ fragmentShader:"
+ uniform sampler2D noise;
+ uniform sampler2D source;
+ uniform highp float t;
+ uniform lowp float qt_Opacity;
+ varying highp vec2 qt_TexCoord0;
+ void main(){
+ //Want to use noise2, but it always returns (0,0)?
+ if(texture2D(noise, qt_TexCoord0).w <= t)
+ gl_FragColor = texture2D(source, qt_TexCoord0) * qt_Opacity;
+ else
+ gl_FragColor = vec4(0.,0.,0.,0.);
+ }
+ "
+ }
+ ParticleSystem{
+ id: imageSystem
+ }
+ Emitter{
+ id: pixelEmitter
+ system: imageSystem
+ //anchors.fill: parent
+ width: Math.min(bigImage.width * bigImage.scale, flickable.width);
+ height: Math.min(bigImage.height * bigImage.scale, flickable.height);
+ anchors.centerIn: parent
+ size: 4
+ lifeSpan: flipDuration
+ emitRate: 2048
+ enabled: false
+ }
+ CustomParticle{
+ id: blowOut
+ system: imageSystem
+ property real maxWidth: effectBox.width
+ property real maxHeight: effectBox.height
+ vertexShader:"
+ uniform highp float maxWidth;
+ uniform highp float maxHeight;
+
+ varying highp vec2 fTex2;
+
+ void main() {
+ defaultMain();
+ fTex2 = vec2(qt_ParticlePos.x / maxWidth, qt_ParticlePos.y / maxHeight);
+ }
+ "
+ property variant pictureTexture: pictureSource
+ fragmentShader: "
+ uniform lowp float qt_Opacity;
+ uniform sampler2D pictureTexture;
+ varying highp vec2 fTex2;
+ void main() {
+ gl_FragColor = texture2D(pictureTexture, fTex2) * qt_Opacity;
+ }"
+ }
+
+
+
+ }
+ }
+ }
+
+ Text {
+ text: "Image Unavailable"
+ visible: bigImage.status == Image.Error
+ anchors.centerIn: parent; color: "white"; font.bold: true
+ }
+
+ Slider {
+ id: slider; visible: { bigImage.status == Image.Ready && maximum > minimum }
+ anchors {
+ bottom: parent.bottom; bottomMargin: 65
+ left: parent.left; leftMargin: 25
+ right: parent.right; rightMargin: 25
+ }
+ onValueChanged: {
+ if (bigImage.width * value > flickable.width) {
+ var xoff = (flickable.width/2 + flickable.contentX) * value / prevScale;
+ flickable.contentX = xoff - flickable.width/2;
+ }
+ if (bigImage.height * value > flickable.height) {
+ var yoff = (flickable.height/2 + flickable.contentY) * value / prevScale;
+ flickable.contentY = yoff - flickable.height/2;
+ }
+ prevScale = value;
+ }
+ }
+ }
+
+ states: State {
+ name: "Back"
+ PropertyChanges { target: itemRotation; angle: 180 }
+ PropertyChanges { target: toolBar; button2Visible: false }
+ PropertyChanges { target: toolBar; button1Label: "Back" }
+ PropertyChanges { target: bigImage; inBackState: true }
+ }
+
+ transitions: Transition {
+ SequentialAnimation {
+ PropertyAction { target: bigImage; property: "smooth"; value: false }
+ NumberAnimation { easing.type: Easing.InOutQuad; properties: "angle"; duration: flipDuration }
+ PropertyAction { target: bigImage; property: "smooth"; value: !flickable.movingVertically }
+ }
+ }
+}
diff --git a/examples/demos/flickr/content/ListDelegate.qml b/examples/demos/flickr/content/ListDelegate.qml
new file mode 100644
index 0000000000..00f837f862
--- /dev/null
+++ b/examples/demos/flickr/content/ListDelegate.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Component {
+ Item {
+ id: wrapper; width: wrapper.ListView.view.width; height: 86
+ Item {
+ id: moveMe
+ Rectangle { color: "black"; opacity: index % 2 ? 0.2 : 0.4; height: 84; width: wrapper.width; y: 1 }
+ Rectangle {
+ x: 6; y: 4; width: 77; height: 77; color: "white"; smooth: true
+
+ Image { source: imagePath; x: 1; y: 1 }
+ Image { source: "images/gloss.png" }
+ }
+ Column {
+ x: 92; width: wrapper.ListView.view.width - 95; y: 15; spacing: 2
+ Text { text: title; color: "white"; width: parent.width; font.pixelSize: 14; font.bold: true; elide: Text.ElideRight; style: Text.Raised; styleColor: "black" }
+ Text { text: photoAuthor; width: parent.width; font.pixelSize: 14; elide: Text.ElideLeft; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ Text { text: photoDate; width: parent.width; font.pixelSize: 14; elide: Text.ElideRight; color: "#cccccc"; style: Text.Raised; styleColor: "black" }
+ }
+ }
+ }
+}
diff --git a/examples/demos/flickr/content/Progress.qml b/examples/demos/flickr/content/Progress.qml
new file mode 100644
index 0000000000..ed2629b48a
--- /dev/null
+++ b/examples/demos/flickr/content/Progress.qml
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item{
+ id: container
+ property variant progress: 0
+
+ Rectangle {
+ anchors.fill: parent; smooth: true
+ border.color: "white"; border.width: 0; radius: height/2 - 2
+ gradient: Gradient {
+ GradientStop { position: 0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
+ }
+
+ ParticleSystem{
+ running: container.visible
+ id: barSys
+ }
+ ImageParticle{
+ color: "lightsteelblue"
+ alpha: 0.1
+ colorVariation: 0.05
+ source: "images/particle.png"
+ system: barSys
+ }
+ Emitter{
+ y: 2; height: parent.height-4;
+ x: 2; width: Math.max(parent.width * progress - 4, 0);
+ speed: AngleDirection{ angleVariation: 180; magnitudeVariation: 12 }
+ system: barSys
+ emitRate: width;
+ lifeSpan: 1000
+ size: 20
+ sizeVariation: 4
+ endSize: 12
+ maximumEmitted: parent.width;
+ }
+
+ Text {
+ text: Math.round(progress * 100) + "%"
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ color: Qt.rgba(1.0, 1.0 - progress, 1.0 - progress,0.9); font.bold: true; font.pixelSize: 15
+ }
+}
diff --git a/examples/demos/flickr/content/RssModel.qml b/examples/demos/flickr/content/RssModel.qml
new file mode 100644
index 0000000000..51cea498e6
--- /dev/null
+++ b/examples/demos/flickr/content/RssModel.qml
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.XmlListModel 2.0
+
+XmlListModel {
+ property string tags : ""
+
+ function encodeTags(x) { return encodeURIComponent(x.replace(' ',',')); }
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+encodeTags(tags)+"&" : "")+"format=rss2"
+ query: "/rss/channel/item"
+ namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "imagePath"; query: "media:thumbnail/@url/string()" }
+ XmlRole { name: "url"; query: "media:content/@url/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ XmlRole { name: "tags"; query: "media:category/string()" }
+ XmlRole { name: "photoWidth"; query: "media:content/@width/string()" }
+ XmlRole { name: "photoHeight"; query: "media:content/@height/string()" }
+ XmlRole { name: "photoType"; query: "media:content/@type/string()" }
+ XmlRole { name: "photoAuthor"; query: "author/string()" }
+ XmlRole { name: "photoDate"; query: "pubDate/string()" }
+}
diff --git a/examples/demos/flickr/content/ScrollBar.qml b/examples/demos/flickr/content/ScrollBar.qml
new file mode 100644
index 0000000000..7c62ad088f
--- /dev/null
+++ b/examples/demos/flickr/content/ScrollBar.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ property variant flickableArea
+
+ Rectangle {
+ radius: 5
+ color: "black"
+ opacity: 0.3
+ border.color: "white"
+ border.width: 2
+ x: 0
+ y: flickableArea.visibleArea.yPosition * container.height
+ width: parent.width
+ height: flickableArea.visibleArea.heightRatio * container.height
+ }
+ states: [
+ State {
+ name: "show"
+ when: flickableArea.movingVertically
+ PropertyChanges {
+ target: container
+ opacity: 1
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "*"
+ to: "*"
+ NumberAnimation {
+ target: container
+ properties: "opacity"
+ duration: 400
+ }
+ }
+ ]
+}
diff --git a/examples/demos/flickr/content/Slider.qml b/examples/demos/flickr/content/Slider.qml
new file mode 100644
index 0000000000..c4e743641f
--- /dev/null
+++ b/examples/demos/flickr/content/Slider.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: slider; width: 400; height: 16
+
+ // value is read/write.
+ property real value: 1
+ onValueChanged: updatePos();
+ property real maximum: 1
+ property real minimum: 1
+ property int xMax: width - handle.width - 4
+ onXMaxChanged: updatePos();
+ onMinimumChanged: updatePos();
+
+ function updatePos() {
+ if (maximum > minimum) {
+ var pos = 2 + (value - minimum) * slider.xMax / (maximum - minimum);
+ pos = Math.min(pos, width - handle.width - 2);
+ pos = Math.max(pos, 2);
+ handle.x = pos;
+ } else {
+ handle.x = 2;
+ }
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ border.color: "white"; border.width: 0; radius: 8
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#66343434" }
+ GradientStop { position: 1.0; color: "#66000000" }
+ }
+ }
+
+ Rectangle {
+ id: handle; smooth: true
+ y: 2; width: 30; height: slider.height-4; radius: 6
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "lightgray" }
+ GradientStop { position: 1.0; color: "gray" }
+ }
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent; drag.target: parent
+ drag.axis: Drag.XAxis; drag.minimumX: 2; drag.maximumX: slider.xMax+2
+ onPositionChanged: { value = (maximum - minimum) * (handle.x-2) / slider.xMax + minimum; }
+ }
+ }
+}
diff --git a/examples/demos/flickr/content/TitleBar.qml b/examples/demos/flickr/content/TitleBar.qml
new file mode 100644
index 0000000000..223939f81a
--- /dev/null
+++ b/examples/demos/flickr/content/TitleBar.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: titleBar
+ property string untaggedString: "Uploads from everyone"
+ property string taggedString: "Recent uploads tagged "
+
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Item {
+ id: container
+ width: (parent.width * 2) - 55 ; height: parent.height
+
+ function accept() {
+ imageDetails.closed()
+ titleBar.state = ""
+ background.state = ""
+ rssModel.tags = editor.text
+ }
+
+ Image {
+ id: quitButton
+ anchors.left: parent.left//; anchors.leftMargin: 0
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/quit.png"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+
+ Text {
+ id: categoryText
+ anchors {
+ left: quitButton.right; right: tagButton.left; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ elide: Text.ElideLeft
+ text: (rssModel.tags=="" ? untaggedString : taggedString + rssModel.tags)
+ font.bold: true; font.pixelSize: 15; color: "White"; style: Text.Raised; styleColor: "Black"
+ }
+
+ Button {
+ id: tagButton; x: titleBar.width - 50; width: 45; height: 32; text: "..."
+ onClicked: if (titleBar.state == "Tags") container.accept(); else titleBar.state = "Tags"
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Item {
+ id: lineEdit
+ y: 4; height: parent.height - 9
+ anchors { left: tagButton.right; leftMargin: 5; right: parent.right; rightMargin: 5 }
+
+ BorderImage { source: "images/lineedit.sci"; anchors.fill: parent }
+
+ TextInput {
+ id: editor
+ anchors {
+ left: parent.left; right: parent.right; leftMargin: 10; rightMargin: 10
+ verticalCenter: parent.verticalCenter
+ }
+ cursorVisible: true; font.bold: true
+ color: "#151515"; selectionColor: "Green"
+ }
+
+ Keys.forwardTo: [ (returnKey), (editor)]
+
+ Item {
+ id: returnKey
+ Keys.onReturnPressed: container.accept()
+ Keys.onEnterPressed: container.accept()
+ Keys.onEscapePressed: titleBar.state = ""
+ }
+ }
+ }
+
+ states: State {
+ name: "Tags"
+ PropertyChanges { target: container; x: -tagButton.x + 5 }
+ PropertyChanges { target: tagButton; text: "OK" }
+ PropertyChanges { target: editor; focus: true }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
+ }
+}
diff --git a/examples/demos/flickr/content/ToolBar.qml b/examples/demos/flickr/content/ToolBar.qml
new file mode 100644
index 0000000000..356993b41a
--- /dev/null
+++ b/examples/demos/flickr/content/ToolBar.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: toolbar
+
+ property alias button1Label: button1.text
+ property alias button2Label: button2.text
+ property alias button2Visible: button2.visible
+
+ signal button1Clicked
+ signal button2Clicked
+
+ BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 }
+
+ Row {
+ anchors.right: parent.right; anchors.rightMargin: 5; y: 3; height: 32; spacing: 30
+ Button {
+ id: button1
+ width: 140; height: 32
+ onClicked: toolbar.button1Clicked()
+ }
+
+ Button {
+ id: button2; width: 140; height: 32
+ onClicked: toolbar.button2Clicked()
+ }
+ }
+}
diff --git a/examples/demos/flickr/content/UnifiedDelegate.qml b/examples/demos/flickr/content/UnifiedDelegate.qml
new file mode 100644
index 0000000000..0b068c0abe
--- /dev/null
+++ b/examples/demos/flickr/content/UnifiedDelegate.qml
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Package {
+ function photoClicked() {
+ imageDetails.photoTitle = title;
+ imageDetails.photoTags = tags;
+ imageDetails.photoWidth = photoWidth;
+ imageDetails.photoHeight = photoHeight;
+ imageDetails.photoType = photoType;
+ imageDetails.photoAuthor = photoAuthor;
+ imageDetails.photoDate = photoDate;
+ imageDetails.photoUrl = url;
+ imageDetails.rating = 0;
+ scaleMe.state = "Details";
+ }
+
+ Item {
+ id: gridwrapper;
+ width: GridView.view.cellWidth; height: GridView.view.cellHeight
+ Package.name: "grid"
+ }
+ Item {
+ id: streamwrapper;
+ width: 80; height: 80
+ Package.name: "stream"
+ }
+ Item {
+ //anchors.centerIn: parent//Doesn't animate :(
+ width: 80; height: 80
+ scale: 0.0
+ Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} }
+ id: scaleMe
+
+ Item {
+ id: whiteRectContainer
+ width: 77; height: 77; anchors.centerIn: parent
+ Rectangle {
+ id: whiteRect; width: 77; height: 77; color: "#dddddd"; smooth: true
+ x:0; y:0
+ Image { id: thumb; source: imagePath; x: 1; y: 1; smooth: true }
+ Image { source: "images/gloss.png" }
+ MouseArea { anchors.fill: parent; onClicked: photoClicked() }
+ }
+ }
+
+ Connections {
+ target: toolBar
+ onButton2Clicked: if (scaleMe.state == 'Details' ) scaleMe.state = 'Show'
+ }
+
+ state: 'inStream'
+ states: [
+ State {
+ name: "Show"; when: thumb.status == Image.Ready
+ PropertyChanges { target: scaleMe; scale: 1; }
+ },
+ State {
+ name: "Details"
+ PropertyChanges { target: scaleMe; scale: 1 }
+ ParentChange { target: whiteRect; x: 10; y: 20; parent: imageDetails.frontContainer }
+ PropertyChanges { target: background; state: "DetailedView" }
+ }
+ ]
+ transitions: [
+ Transition {
+ from: "Show"; to: "Details"
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ },
+ Transition {
+ from: "Details"; to: "Show"
+ SequentialAnimation{
+ ParentAnimation {
+ via: foreground
+ NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+ }
+ }
+ ]
+ Item{
+ id: stateContainer
+ states: [
+ State {
+ name: 'inStream'
+ when: screen.inGridView == false
+ ParentChange {
+ target: scaleMe; parent: streamwrapper
+ x: 0; y: 0;
+ }
+ },
+ State {
+ name: 'inGrid'
+ when: screen.inGridView == true
+ ParentChange {
+ target: scaleMe; parent: gridwrapper
+ x: 0; y: 0;
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ ParentAnimation {
+ NumberAnimation { target: scaleMe; properties: 'x,y,width,height'; duration: 300 }
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/examples/demos/flickr/content/images/gloss.png b/examples/demos/flickr/content/images/gloss.png
new file mode 100644
index 0000000000..5d370cd93d
--- /dev/null
+++ b/examples/demos/flickr/content/images/gloss.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/lineedit.png b/examples/demos/flickr/content/images/lineedit.png
new file mode 100644
index 0000000000..2cc38dc35b
--- /dev/null
+++ b/examples/demos/flickr/content/images/lineedit.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/lineedit.sci b/examples/demos/flickr/content/images/lineedit.sci
new file mode 100644
index 0000000000..054bff78be
--- /dev/null
+++ b/examples/demos/flickr/content/images/lineedit.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 10
+border.bottom: 10
+border.right: 10
+source: lineedit.png
diff --git a/examples/demos/flickr/content/images/noise.png b/examples/demos/flickr/content/images/noise.png
new file mode 100644
index 0000000000..c5a5ba0053
--- /dev/null
+++ b/examples/demos/flickr/content/images/noise.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/particle.png b/examples/demos/flickr/content/images/particle.png
new file mode 100644
index 0000000000..dbc39cb16e
--- /dev/null
+++ b/examples/demos/flickr/content/images/particle.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/quit.png b/examples/demos/flickr/content/images/quit.png
new file mode 100644
index 0000000000..5bda1b6e0d
--- /dev/null
+++ b/examples/demos/flickr/content/images/quit.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/squareParticle.png b/examples/demos/flickr/content/images/squareParticle.png
new file mode 100644
index 0000000000..faf85c24e0
--- /dev/null
+++ b/examples/demos/flickr/content/images/squareParticle.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/stripes.png b/examples/demos/flickr/content/images/stripes.png
new file mode 100644
index 0000000000..9f36727ea4
--- /dev/null
+++ b/examples/demos/flickr/content/images/stripes.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/titlebar.png b/examples/demos/flickr/content/images/titlebar.png
new file mode 100644
index 0000000000..51c90082d0
--- /dev/null
+++ b/examples/demos/flickr/content/images/titlebar.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/titlebar.sci b/examples/demos/flickr/content/images/titlebar.sci
new file mode 100644
index 0000000000..0418d94cd6
--- /dev/null
+++ b/examples/demos/flickr/content/images/titlebar.sci
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/examples/demos/flickr/content/images/toolbutton.png b/examples/demos/flickr/content/images/toolbutton.png
new file mode 100644
index 0000000000..11310013ee
--- /dev/null
+++ b/examples/demos/flickr/content/images/toolbutton.png
Binary files differ
diff --git a/examples/demos/flickr/content/images/toolbutton.sci b/examples/demos/flickr/content/images/toolbutton.sci
new file mode 100644
index 0000000000..9e4f965307
--- /dev/null
+++ b/examples/demos/flickr/content/images/toolbutton.sci
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton.png
diff --git a/examples/demos/flickr/content/qmldir b/examples/demos/flickr/content/qmldir
new file mode 100644
index 0000000000..adc2479b9f
--- /dev/null
+++ b/examples/demos/flickr/content/qmldir
@@ -0,0 +1,10 @@
+ImageDetails ImageDetails.qml
+LikeOMeter LikeOMeter.qml
+Loading Loading.qml
+MediaButton MediaButton.qml
+MediaLineEdit MediaLineEdit.qml
+Progress Progress.qml
+RssModel RssModel.qml
+ScrollBar ScrollBar.qml
+Slider Slider.qml
+Star Star.qml
diff --git a/examples/demos/flickr/flickr-90.qml b/examples/demos/flickr/flickr-90.qml
new file mode 100644
index 0000000000..b95b1c9872
--- /dev/null
+++ b/examples/demos/flickr/flickr-90.qml
@@ -0,0 +1,52 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ width: 480; height: 320
+
+ Loader {
+ y: 320; rotation: -90
+ transformOrigin: Item.TopLeft
+ source: "flickr.qml"
+ }
+}
diff --git a/examples/demos/flickr/flickr.qml b/examples/demos/flickr/flickr.qml
new file mode 100644
index 0000000000..98ca5197ab
--- /dev/null
+++ b/examples/demos/flickr/flickr.qml
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+import "content"
+
+Item {
+ id: screen; width: 320; height: 480
+ property bool inGridView : true
+
+ Rectangle {
+ id: background
+ anchors.fill: parent; color: "#343434";
+
+ Image { source: "content/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 }
+ ParticleSystem {
+ id: bgParticles
+ anchors.fill: parent
+ ImageParticle {
+ groups: ["trail"]
+ source: "content/images/particle.png"
+ color: "#1A1A6F"
+ alpha: 0.1
+ colorVariation: 0.01
+ blueVariation: 0.8
+ }
+ Emitter {
+ group: "drops"
+ width: parent.width
+ emitRate: 0.5
+ lifeSpan: 20000
+ startTime: 16000
+ speed: PointDirection{
+ y: {screen.height/18}
+ }
+ }
+ TrailEmitter {
+ follow: "drops"
+ group: "trail"
+ emitRatePerParticle: 18
+ size: 32
+ endSize: 0
+ sizeVariation: 4
+ lifeSpan: 1200
+ anchors.fill: parent
+ emitWidth: 16
+ emitHeight: 16
+ emitShape: EllipseShape{}
+ }
+ }
+
+ VisualDataModel{
+ id: vdm
+ delegate: UnifiedDelegate{}
+ model: RssModel { id: rssModel }
+ }
+
+ Item {
+ id: views
+ width: parent.width
+ anchors.top: titleBar.bottom; anchors.bottom: toolBar.top
+
+ GridView {
+ id: photoGridView; model: vdm.parts.grid
+ cacheBuffer: 1000
+ cellWidth: (parent.width-2)/4; cellHeight: cellWidth; width: parent.width; height: parent.height
+ }
+
+ states: State {
+ name: "GridView"; when: state.inGridView == true
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+
+ ImageDetails { id: imageDetails; width: parent.width; anchors.left: views.right; height: parent.height }
+
+ Item { id: foreground; anchors.fill: parent }
+ }
+
+ TitleBar { id: titleBar; width: parent.width; height: 40; opacity: 0.9 }
+
+ ToolBar {
+ id: toolBar
+ height: 40; anchors.bottom: parent.bottom; width: parent.width; opacity: 0.9
+ button1Label: "Update"; button2Label: "View mode"
+ onButton1Clicked: rssModel.reload()
+ onButton2Clicked: if (screen.inGridView == true) screen.inGridView = false; else screen.inGridView = true
+ }
+
+ Connections {
+ target: imageDetails
+ onClosed: {
+ if (background.state == "DetailedView") {
+ background.state = '';
+ imageDetails.photoUrl = "";
+ }
+ }
+ }
+
+ states: State {
+ name: "DetailedView"
+ PropertyChanges { target: views; x: -parent.width }
+ PropertyChanges { target: toolBar; button1Label: "View..." }
+ PropertyChanges {
+ target: toolBar
+ onButton1Clicked: if (imageDetails.state=='') imageDetails.state='Back'; else imageDetails.state=''
+ }
+ PropertyChanges { target: toolBar; button2Label: "Back" }
+ PropertyChanges { target: toolBar; onButton2Clicked: imageDetails.closed() }
+ }
+
+ transitions: Transition {
+ NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad }
+ }
+
+ }
+}
diff --git a/examples/demos/flickr/flickr.qmlproject b/examples/demos/flickr/flickr.qmlproject
new file mode 100644
index 0000000000..af5179d84b
--- /dev/null
+++ b/examples/demos/flickr/flickr.qmlproject
@@ -0,0 +1,17 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "flickr.qml"
+ //mainFile: "flickr-90.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+}
diff --git a/examples/demos/minehunt/MinehuntCore/Explosion.qml b/examples/demos/minehunt/MinehuntCore/Explosion.qml
new file mode 100644
index 0000000000..a1b4292bcf
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/Explosion.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ property bool explode : false
+ ParticleSystem {
+ width: 40
+ height: 40
+ ImageParticle {
+ groups: ["star"]
+ source: "file:MinehuntCore/pics/star.png" // TODO: Use qrc path once QTBUG-21129 is fixed
+ }
+ Emitter {
+ id: particles
+ enabled: false
+ anchors.centerIn: parent
+ group: "star"
+ speed: AngleDirection { angleVariation: 360; magnitude: 150; magnitudeVariation: 50 }
+ emitRate: 200
+ z: 100
+ lifeSpan: 1000
+ }
+ }
+ states: State { name: "exploding"; when: explode
+ StateChangeScript { script: particles.burst(200); }
+ }
+
+}
diff --git a/examples/demos/minehunt/MinehuntCore/Tile.qml b/examples/demos/minehunt/MinehuntCore/Tile.qml
new file mode 100644
index 0000000000..1180b6f584
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/Tile.qml
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Flipable {
+ id: flipable
+ property int angle: 0
+
+ width: 40; height: 40
+ transform: Rotation { origin.x: 20; origin.y: 20; axis.x: 1; axis.z: 0; angle: flipable.angle }
+
+ front: Image {
+ source: "pics/front.png"; width: 40; height: 40
+
+ Image {
+ anchors.centerIn: parent
+ source: "pics/flag.png"; opacity: modelData.hasFlag
+
+ Behavior on opacity { NumberAnimation {} }
+ }
+ }
+
+ back: Image {
+ source: "pics/back.png"
+ width: 40; height: 40
+
+ Text {
+ anchors.centerIn: parent
+ text: modelData.hint; color: "white"; font.bold: true
+ opacity: !modelData.hasMine && modelData.hint > 0
+ }
+
+ Image {
+ anchors.centerIn: parent
+ source: "pics/bomb.png"; opacity: modelData.hasMine
+ }
+
+ Explosion { id: expl }
+ }
+
+ states: State {
+ name: "back"; when: modelData.flipped
+ PropertyChanges { target: flipable; angle: 180 }
+ }
+
+ property real pauseDur: 250
+ transitions: Transition {
+ SequentialAnimation {
+ ScriptAction {
+ script: {
+ var ret = Math.abs(flipable.x - field.clickx)
+ + Math.abs(flipable.y - field.clicky);
+ if (modelData.hasMine && modelData.flipped)
+ pauseDur = ret * 3
+ else
+ pauseDur = ret
+ }
+ }
+ PauseAnimation {
+ duration: pauseDur
+ }
+ RotationAnimation { easing.type: Easing.InOutQuad }
+ ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton
+ onClicked: {
+ field.clickx = flipable.x
+ field.clicky = flipable.y
+ var row = Math.floor(index / 9)
+ var col = index - (Math.floor(index / 9) * 9)
+ if (mouse.button == undefined || mouse.button == Qt.RightButton) {
+ flag(row, col)
+ } else {
+ flip(row, col)
+ }
+ }
+ onPressAndHold: {
+ field.clickx = flipable.x
+ field.clicky = flipable.y
+ var row = Math.floor(index / 9)
+ var col = index - (Math.floor(index / 9) * 9)
+ flag(row, col)
+ }
+ }
+}
diff --git a/examples/demos/minehunt/MinehuntCore/pics/back.png b/examples/demos/minehunt/MinehuntCore/pics/back.png
new file mode 100644
index 0000000000..f6b3f0b4d7
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/back.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/background.png b/examples/demos/minehunt/MinehuntCore/pics/background.png
new file mode 100644
index 0000000000..3734a27744
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/background.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/bomb-color.png b/examples/demos/minehunt/MinehuntCore/pics/bomb-color.png
new file mode 100644
index 0000000000..61ad0a928f
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/bomb-color.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/bomb.png b/examples/demos/minehunt/MinehuntCore/pics/bomb.png
new file mode 100644
index 0000000000..a992575518
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/bomb.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/face-sad.png b/examples/demos/minehunt/MinehuntCore/pics/face-sad.png
new file mode 100644
index 0000000000..cf00aafe1f
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/face-sad.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/face-smile-big.png b/examples/demos/minehunt/MinehuntCore/pics/face-smile-big.png
new file mode 100644
index 0000000000..f9c2335df5
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/face-smile-big.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/face-smile.png b/examples/demos/minehunt/MinehuntCore/pics/face-smile.png
new file mode 100644
index 0000000000..3d66d72578
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/face-smile.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/flag-color.png b/examples/demos/minehunt/MinehuntCore/pics/flag-color.png
new file mode 100644
index 0000000000..aadad0f11a
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/flag-color.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/flag.png b/examples/demos/minehunt/MinehuntCore/pics/flag.png
new file mode 100644
index 0000000000..39cde4df82
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/flag.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/front.png b/examples/demos/minehunt/MinehuntCore/pics/front.png
new file mode 100644
index 0000000000..834331bd49
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/front.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/quit.png b/examples/demos/minehunt/MinehuntCore/pics/quit.png
new file mode 100644
index 0000000000..b822057d4e
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/quit.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/pics/star.png b/examples/demos/minehunt/MinehuntCore/pics/star.png
new file mode 100644
index 0000000000..3772359188
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/pics/star.png
Binary files differ
diff --git a/examples/demos/minehunt/MinehuntCore/qmldir b/examples/demos/minehunt/MinehuntCore/qmldir
new file mode 100644
index 0000000000..a0213a19c4
--- /dev/null
+++ b/examples/demos/minehunt/MinehuntCore/qmldir
@@ -0,0 +1,2 @@
+Explosion 2.0 Explosion.qml
+Tile 2.0 Tile.qml
diff --git a/examples/demos/minehunt/README b/examples/demos/minehunt/README
new file mode 100644
index 0000000000..3849ca5fbf
--- /dev/null
+++ b/examples/demos/minehunt/README
@@ -0,0 +1,6 @@
+Minehunt has to be compiled to run.
+
+To compile the C++ part, do 'qmake && make'.
+To run, simply run the executable.
+To deploy on a device, do 'make sis'.
+
diff --git a/examples/demos/minehunt/main.cpp b/examples/demos/minehunt/main.cpp
new file mode 100644
index 0000000000..0aa11a1d7a
--- /dev/null
+++ b/examples/demos/minehunt/main.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QGuiApplication>
+#include <QtQuick/qquickview.h>
+#include <QtQml/QQmlContext>
+#include <QtQml/QQmlEngine>
+
+#include "minehunt.h"
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+ QQuickView canvas;
+
+ qmlRegisterType<TileData>();
+ MinehuntGame* game = new MinehuntGame();
+
+ canvas.setResizeMode(QQuickView::SizeRootObjectToView);
+ canvas.engine()->rootContext()->setContextObject(game);
+ canvas.setSource(QString("qrc:///minehunt.qml"));
+ QObject::connect(canvas.engine(), SIGNAL(quit()), &app, SLOT(quit()));
+
+ canvas.show();
+ return app.exec();
+}
diff --git a/examples/demos/minehunt/minehunt.cpp b/examples/demos/minehunt/minehunt.cpp
new file mode 100644
index 0000000000..cde30278b3
--- /dev/null
+++ b/examples/demos/minehunt/minehunt.cpp
@@ -0,0 +1,221 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <stdlib.h>
+#include <QTime>
+#include <QTimer>
+
+#include "minehunt.h"
+
+void tilesPropAppend(QQmlListProperty<TileData>* prop, TileData* value)
+{
+ Q_UNUSED(prop);
+ Q_UNUSED(value);
+ return; //Append not supported
+}
+
+int tilesPropCount(QQmlListProperty<TileData>* prop)
+{
+ return static_cast<QList<TileData*>*>(prop->data)->count();
+}
+
+TileData* tilesPropAt(QQmlListProperty<TileData>* prop, int index)
+{
+ return static_cast<QList<TileData*>*>(prop->data)->at(index);
+}
+
+QQmlListProperty<TileData> MinehuntGame::tiles(){
+ return QQmlListProperty<TileData>(this, &_tiles, &tilesPropAppend,
+ &tilesPropCount, &tilesPropAt, 0);
+}
+
+MinehuntGame::MinehuntGame()
+: numCols(9), numRows(9), playing(true), won(false)
+{
+ setObjectName("mainObject");
+ srand(QTime(0,0,0).secsTo(QTime::currentTime()));
+
+ //initialize array
+ for(int ii = 0; ii < numRows * numCols; ++ii) {
+ _tiles << new TileData;
+ }
+ reset();
+
+}
+
+void MinehuntGame::setBoard()
+{
+ foreach(TileData* t, _tiles){
+ t->setHasMine(false);
+ t->setHint(-1);
+ }
+ //place mines
+ int mines = nMines;
+ remaining = numRows*numCols-mines;
+ while ( mines ) {
+ int col = int((double(rand()) / double(RAND_MAX)) * numCols);
+ int row = int((double(rand()) / double(RAND_MAX)) * numRows);
+
+ TileData* t = tile( row, col );
+
+ if (t && !t->hasMine()) {
+ t->setHasMine( true );
+ mines--;
+ }
+ }
+
+ //set hints
+ for (int r = 0; r < numRows; r++)
+ for (int c = 0; c < numCols; c++) {
+ TileData* t = tile(r, c);
+ if (t && !t->hasMine()) {
+ int hint = getHint(r,c);
+ t->setHint(hint);
+ }
+ }
+
+ setPlaying(true);
+}
+
+void MinehuntGame::reset()
+{
+ foreach(TileData* t, _tiles){
+ t->unflip();
+ t->setHasFlag(false);
+ }
+ nMines = 12;
+ nFlags = 0;
+ emit numMinesChanged();
+ emit numFlagsChanged();
+ setPlaying(false);
+ QTimer::singleShot(600,this, SLOT(setBoard()));
+}
+
+int MinehuntGame::getHint(int row, int col)
+{
+ int hint = 0;
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData* t = tile(r, c);
+ if (t && t->hasMine())
+ hint++;
+ }
+ return hint;
+}
+
+bool MinehuntGame::flip(int row, int col)
+{
+ if(!playing)
+ return false;
+
+ TileData *t = tile(row, col);
+ if (!t || t->hasFlag())
+ return false;
+
+ if(t->flipped()){
+ int flags = 0;
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData *nearT = tile(r, c);
+ if(!nearT || nearT == t)
+ continue;
+ if(nearT->hasFlag())
+ flags++;
+ }
+ if(!t->hint() || t->hint() != flags)
+ return false;
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData *nearT = tile(r, c);
+ if (nearT && !nearT->flipped() && !nearT->hasFlag()) {
+ flip( r, c );
+ }
+ }
+ return true;
+ }
+
+ t->flip();
+
+ if (t->hint() == 0) {
+ for (int c = col-1; c <= col+1; c++)
+ for (int r = row-1; r <= row+1; r++) {
+ TileData* t = tile(r, c);
+ if (t && !t->flipped()) {
+ flip( r, c );
+ }
+ }
+ }
+
+ if(t->hasMine()){
+ for (int r = 0; r < numRows; r++)//Flip all other mines
+ for (int c = 0; c < numCols; c++) {
+ TileData* t = tile(r, c);
+ if (t && t->hasMine()) {
+ flip(r, c);
+ }
+ }
+ won = false;
+ hasWonChanged();
+ setPlaying(false);
+ return true;
+ }
+
+ remaining--;
+ if(!remaining){
+ won = true;
+ hasWonChanged();
+ setPlaying(false);
+ return true;
+ }
+ return true;
+}
+
+bool MinehuntGame::flag(int row, int col)
+{
+ TileData *t = tile(row, col);
+ if(!t || !playing || t->flipped())
+ return false;
+
+ t->setHasFlag(!t->hasFlag());
+ nFlags += (t->hasFlag()?1:-1);
+ emit numFlagsChanged();
+ return true;
+}
diff --git a/examples/demos/minehunt/minehunt.h b/examples/demos/minehunt/minehunt.h
new file mode 100644
index 0000000000..34bab71218
--- /dev/null
+++ b/examples/demos/minehunt/minehunt.h
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <qqml.h>
+
+class TileData : public QObject
+{
+ Q_OBJECT
+public:
+ TileData() : _hasFlag(false), _hasMine(false), _hint(-1), _flipped(false) {}
+
+ Q_PROPERTY(bool hasFlag READ hasFlag WRITE setHasFlag NOTIFY hasFlagChanged)
+ bool hasFlag() const { return _hasFlag; }
+
+ Q_PROPERTY(bool hasMine READ hasMine NOTIFY hasMineChanged)
+ bool hasMine() const { return _hasMine; }
+
+ Q_PROPERTY(int hint READ hint NOTIFY hintChanged)
+ int hint() const { return _hint; }
+
+ Q_PROPERTY(bool flipped READ flipped NOTIFY flippedChanged())
+ bool flipped() const { return _flipped; }
+
+ void setHasFlag(bool flag) {if(flag==_hasFlag) return; _hasFlag = flag; emit hasFlagChanged();}
+ void setHasMine(bool mine) {if(mine==_hasMine) return; _hasMine = mine; emit hasMineChanged();}
+ void setHint(int hint) { if(hint == _hint) return; _hint = hint; emit hintChanged(); }
+ void flip() { if (_flipped) return; _flipped = true; emit flippedChanged(); }
+ void unflip() { if(!_flipped) return; _flipped = false; emit flippedChanged(); }
+
+signals:
+ void flippedChanged();
+ void hasFlagChanged();
+ void hintChanged();
+ void hasMineChanged();
+
+private:
+ bool _hasFlag;
+ bool _hasMine;
+ int _hint;
+ bool _flipped;
+};
+
+class MinehuntGame : public QObject
+{
+ Q_OBJECT
+public:
+ MinehuntGame();
+
+ Q_PROPERTY(QQmlListProperty<TileData> tiles READ tiles CONSTANT)
+ QQmlListProperty<TileData> tiles();
+
+ Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged)
+ bool isPlaying() {return playing;}
+
+ Q_PROPERTY(bool hasWon READ hasWon NOTIFY hasWonChanged)
+ bool hasWon() {return won;}
+
+ Q_PROPERTY(int numMines READ numMines NOTIFY numMinesChanged)
+ int numMines() const{return nMines;}
+
+ Q_PROPERTY(int numFlags READ numFlags NOTIFY numFlagsChanged)
+ int numFlags() const{return nFlags;}
+
+public slots:
+ Q_INVOKABLE bool flip(int row, int col);
+ Q_INVOKABLE bool flag(int row, int col);
+ void setBoard();
+ void reset();
+
+signals:
+ void isPlayingChanged();
+ void hasWonChanged();
+ void numMinesChanged();
+ void numFlagsChanged();
+
+private:
+ bool onBoard( int r, int c ) const { return r >= 0 && r < numRows && c >= 0 && c < numCols; }
+ TileData *tile( int row, int col ) { return onBoard(row, col) ? _tiles[col+numRows*row] : 0; }
+ int getHint(int row, int col);
+ void setPlaying(bool b){if(b==playing) return; playing=b; emit isPlayingChanged();}
+
+ QList<TileData *> _tiles;
+ int numCols;
+ int numRows;
+ bool playing;
+ bool won;
+ int remaining;
+ int nMines;
+ int nFlags;
+};
diff --git a/examples/demos/minehunt/minehunt.pro b/examples/demos/minehunt/minehunt.pro
new file mode 100644
index 0000000000..78e874d805
--- /dev/null
+++ b/examples/demos/minehunt/minehunt.pro
@@ -0,0 +1,5 @@
+QT += qml quick
+
+HEADERS += minehunt.h
+SOURCES += main.cpp minehunt.cpp
+RESOURCES = minehunt.qrc
diff --git a/examples/demos/minehunt/minehunt.qml b/examples/demos/minehunt/minehunt.qml
new file mode 100644
index 0000000000..42dc408fff
--- /dev/null
+++ b/examples/demos/minehunt/minehunt.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import "MinehuntCore" 2.0
+
+Item {
+ id: field
+ property int clickx: 0
+ property int clicky: 0
+
+ width: 450; height: 450
+
+ Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile }
+
+ Grid {
+ anchors.horizontalCenter: parent.horizontalCenter
+ columns: 9; spacing: 1
+
+ Repeater {
+ id: repeater
+ model: tiles
+ delegate: Tile {}
+ }
+ }
+
+ Row {
+ id: gamedata
+ x: 20; spacing: 20
+ anchors.bottom: field.bottom; anchors.bottomMargin: 15
+
+ Image {
+ source: "MinehuntCore/pics/quit.png"
+ scale: quitMouse.pressed ? 0.8 : 1.0
+ smooth: quitMouse.pressed
+ y: 10
+ MouseArea {
+ id: quitMouse
+ anchors.fill: parent
+ anchors.margins: -20
+ onClicked: Qt.quit()
+ }
+ }
+ Column {
+ spacing: 2
+ Image { source: "MinehuntCore/pics/bomb-color.png" }
+ Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numMines }
+ }
+
+ Column {
+ spacing: 2
+ Image { source: "MinehuntCore/pics/flag-color.png" }
+ Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numFlags }
+ }
+ }
+
+ Image {
+ anchors.bottom: field.bottom; anchors.bottomMargin: 15
+ anchors.right: field.right; anchors.rightMargin: 20
+ source: isPlaying ? 'MinehuntCore/pics/face-smile.png' :
+ hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png'
+
+ MouseArea { anchors.fill: parent; onPressed: reset() }
+ }
+ Text {
+ anchors.centerIn: parent; width: parent.width - 20
+ horizontalAlignment: Text.AlignHCenter
+ wrapMode: Text.WordWrap
+ text: "Minehunt demo has to be compiled to run.\n\nPlease see README."
+ color: "white"; font.bold: true; font.pixelSize: 14
+ visible: tiles == undefined
+ }
+
+}
diff --git a/examples/demos/minehunt/minehunt.qmlproject b/examples/demos/minehunt/minehunt.qmlproject
new file mode 100644
index 0000000000..5aeb78f1ea
--- /dev/null
+++ b/examples/demos/minehunt/minehunt.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "minehunt.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+}
diff --git a/examples/demos/minehunt/minehunt.qrc b/examples/demos/minehunt/minehunt.qrc
new file mode 100644
index 0000000000..fa8e27d383
--- /dev/null
+++ b/examples/demos/minehunt/minehunt.qrc
@@ -0,0 +1,20 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>minehunt.qml</file>
+ <file>MinehuntCore/Explosion.qml</file>
+ <file>MinehuntCore/Tile.qml</file>
+ <file>MinehuntCore/qmldir</file>
+ <file>MinehuntCore/pics/background.png</file>
+ <file>MinehuntCore/pics/back.png</file>
+ <file>MinehuntCore/pics/bomb-color.png</file>
+ <file>MinehuntCore/pics/bomb.png</file>
+ <file>MinehuntCore/pics/face-sad.png</file>
+ <file>MinehuntCore/pics/face-smile-big.png</file>
+ <file>MinehuntCore/pics/face-smile.png</file>
+ <file>MinehuntCore/pics/flag-color.png</file>
+ <file>MinehuntCore/pics/flag.png</file>
+ <file>MinehuntCore/pics/front.png</file>
+ <file>MinehuntCore/pics/quit.png</file>
+ <file>MinehuntCore/pics/star.png</file>
+</qresource>
+</RCC>
diff --git a/examples/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/examples/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
new file mode 100644
index 0000000000..164f47faa9
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
@@ -0,0 +1,147 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.XmlListModel 2.0
+
+Component {
+ id: albumDelegate
+ Package {
+
+ Item {
+ Package.name: 'browser'
+ GridView {
+ id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21
+ x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false
+ onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain)
+ }
+ }
+
+ Item {
+ Package.name: 'fullscreen'
+ ListView {
+ id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal
+ width: mainWindow.width; height: mainWindow.height; interactive: false
+ onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain)
+ highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem
+ }
+ }
+
+ Item {
+ Package.name: 'album'
+ id: albumWrapper; width: 210; height: 220
+
+ VisualDataModel {
+ id: visualModel; delegate: PhotoDelegate { }
+ model: RssModel { id: rssModel; tags: tag }
+ }
+
+ BusyIndicator {
+ id: busyIndicator
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ on: rssModel.status != XmlListModel.Ready
+ }
+
+ PathView {
+ id: photosPathView; model: visualModel.parts.stack; pathItemCount: 5
+ visible: !busyIndicator.visible
+ anchors.centerIn: parent; anchors.verticalCenterOffset: -30
+ path: Path {
+ PathAttribute { name: 'z'; value: 9999.0 }
+ PathLine { x: 1; y: 1 }
+ PathAttribute { name: 'z'; value: 0.0 }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: mainWindow.editMode ? photosModel.remove(index) : albumWrapper.state = 'inGrid'
+ }
+
+ Tag {
+ anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 }
+ frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode
+ onTagChanged: rssModel.tags = tag
+ onBackClicked: if (mainWindow.editMode) photosModel.remove(index);
+ }
+
+ states: [
+ State {
+ name: 'inGrid'
+ PropertyChanges { target: photosGridView; interactive: true }
+ PropertyChanges { target: albumsShade; opacity: 1 }
+ PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 }
+ },
+ State {
+ name: 'fullscreen'; extend: 'inGrid'
+ PropertyChanges { target: photosGridView; interactive: false }
+ PropertyChanges { target: photosListView; interactive: true }
+ PropertyChanges { target: photosShade; opacity: 1 }
+ PropertyChanges { target: backButton; y: -backButton.height - 8 }
+ }
+ ]
+
+ GridView.onAdd: NumberAnimation {
+ target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad
+ }
+ GridView.onRemove: SequentialAnimation {
+ PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true }
+ NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad }
+ PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false }
+ }
+
+ transitions: [
+ Transition {
+ from: '*'; to: 'inGrid'
+ SequentialAnimation {
+ NumberAnimation { properties: 'opacity'; duration: 250 }
+ PauseAnimation { duration: 350 }
+ NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: '*'
+ NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 }
+ }
+ ]
+ }
+ }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml b/examples/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml
new file mode 100644
index 0000000000..867c268399
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+ NumberAnimation on rotation { running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200 }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/Button.qml b/examples/demos/photoviewer/PhotoViewerCore/Button.qml
new file mode 100644
index 0000000000..8f4177c097
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/Button.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ property alias label: labelText.text
+ property color tint: "transparent"
+ signal clicked
+
+ width: labelText.width + 70 ; height: labelText.height + 18
+
+ BorderImage {
+ anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+
+ Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true }
+
+ Rectangle {
+ anchors.fill: container; color: container.tint; visible: container.tint != ""
+ opacity: 0.25; smooth: true
+ }
+
+ Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true }
+
+ MouseArea {
+ anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
+ onClicked: container.clicked()
+ }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/EditableButton.qml b/examples/demos/photoviewer/PhotoViewerCore/EditableButton.qml
new file mode 100644
index 0000000000..435ad2644f
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/EditableButton.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ property string label
+ signal clicked
+ signal labelChanged(string label)
+
+ width: textInput.width + 70 ; height: textInput.height + 18
+
+ BorderImage {
+ anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+
+ Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true }
+
+ TextInput {
+ id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true
+ Keys.onReturnPressed: {
+ container.labelChanged(textInput.text)
+ container.focus = true
+ }
+ Keys.onEnterPressed: {
+ container.labelChanged(textInput.text)
+ container.focus = true
+ }
+ Keys.onEscapePressed: {
+ textInput.text = container.label
+ container.focus = true
+ }
+ }
+
+ Rectangle {
+ anchors.fill: container; border.color: "steelblue"; border.width: 4
+ color: "transparent"; visible: textInput.focus; smooth: true
+ }
+
+ MouseArea {
+ anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
+ onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); }
+ }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/examples/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml
new file mode 100644
index 0000000000..5d4e5aee5d
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml
@@ -0,0 +1,188 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import "script/script.js" as Script
+
+Package {
+ Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z }
+ Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 }
+ Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 }
+
+ Item {
+ width: 160; height: 153
+
+ Item {
+ id: photoWrapper
+
+ property double randomAngle: Math.random() * (2 * 6 + 1) - 6
+ property double randomAngle2: Math.random() * (2 * 6 + 1) - 6
+
+ x: 0; y: 0; width: 140; height: 133
+ z: stackItem.PathView.z; rotation: photoWrapper.randomAngle
+
+ BorderImage {
+ anchors {
+ fill: originalImage.status == Image.Ready ? border : placeHolder
+ leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8
+ }
+ source: 'images/box-shadow.png'; smooth: true
+ border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
+ }
+ Rectangle {
+ id: placeHolder
+
+ property int w: Script.getWidth(content)
+ property int h: Script.getHeight(content)
+ property double s: Script.calculateScale(w, h, photoWrapper.width)
+
+ color: 'white'; anchors.centerIn: parent; smooth: true
+ width: w * s; height: h * s; visible: originalImage.status != Image.Ready
+ Rectangle {
+ color: "#878787"; smooth: true
+ anchors { fill: parent; topMargin: 3; bottomMargin: 3; leftMargin: 3; rightMargin: 3 }
+ }
+ }
+ Rectangle {
+ id: border; color: 'white'; anchors.centerIn: parent; smooth: true
+ width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6
+ visible: !placeHolder.visible
+ }
+ BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready }
+ Image {
+ id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content); cache: false
+ fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
+ }
+ Image {
+ id: hqImage; smooth: true; source: ""; visible: false; cache: false
+ fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
+ }
+ Binding {
+ target: mainWindow; property: "downloadProgress"; value: hqImage.progress
+ when: listItem.ListView.isCurrentItem
+ }
+ Binding {
+ target: mainWindow; property: "imageLoading"
+ value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem
+ }
+ MouseArea {
+ width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage
+ onClicked: {
+ if (albumWrapper.state == 'inGrid') {
+ gridItem.GridView.view.currentIndex = index;
+ albumWrapper.state = 'fullscreen'
+ } else {
+ gridItem.GridView.view.currentIndex = index;
+ albumWrapper.state = 'inGrid'
+ }
+ }
+ }
+
+ states: [
+ State {
+ name: 'stacked'; when: albumWrapper.state == ''
+ ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 }
+ PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 }
+ },
+ State {
+ name: 'inGrid'; when: albumWrapper.state == 'inGrid'
+ ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 }
+ },
+ State {
+ name: 'fullscreen'; when: albumWrapper.state == 'fullscreen'
+ ParentChange {
+ target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0
+ width: mainWindow.width; height: mainWindow.height
+ }
+ PropertyChanges { target: border; opacity: 0 }
+ PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: 'stacked'; to: 'inGrid'
+ SequentialAnimation {
+ PauseAnimation { duration: 10 * index }
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart'
+ }
+ }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: 'stacked'
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' }
+ }
+ },
+ Transition {
+ from: 'inGrid'; to: 'fullscreen'
+ SequentialAnimation {
+ PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 }
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ targets: [ photoWrapper, border ]
+ properties: 'x,y,width,height,opacity,rotation'
+ duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart'
+ }
+ }
+ }
+ },
+ Transition {
+ from: 'fullscreen'; to: 'inGrid'
+ ParentAnimation {
+ target: photoWrapper; via: foreground
+ NumberAnimation {
+ targets: [ photoWrapper, border ]
+ properties: 'x,y,width,height,rotation,opacity'
+ duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart'
+ }
+ }
+ }
+ ]
+ }
+ }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/ProgressBar.qml b/examples/demos/photoviewer/PhotoViewerCore/ProgressBar.qml
new file mode 100644
index 0000000000..58beef57f3
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/ProgressBar.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ property real progress: 0
+
+ Behavior on opacity { NumberAnimation { duration: 600 } }
+
+ Rectangle { anchors.fill: parent; color: "black"; opacity: 0.5 }
+
+ Rectangle {
+ id: fill; color: "white"; height: container.height
+ width: container.width * container.progress
+ }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/RssModel.qml b/examples/demos/photoviewer/PhotoViewerCore/RssModel.qml
new file mode 100644
index 0000000000..1598977bb1
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/RssModel.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.XmlListModel 2.0
+
+XmlListModel {
+ property string tags : ""
+
+ function encodeTags(x) { return encodeURIComponent(x.replace(' ',',')); }
+
+ source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+encodeTags(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/demos/photoviewer/PhotoViewerCore/Tag.qml b/examples/demos/photoviewer/PhotoViewerCore/Tag.qml
new file mode 100644
index 0000000000..ed4a248a7b
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/Tag.qml
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Flipable {
+ id: flipable
+
+ property alias frontLabel: frontButton.label
+ property alias backLabel: backButton.label
+
+ property int angle: 0
+ property int randomAngle: Math.random() * (2 * 6 + 1) - 6
+ property bool flipped: false
+
+ signal frontClicked
+ signal backClicked
+ signal tagChanged(string tag)
+
+ front: EditableButton {
+ id: frontButton; rotation: flipable.randomAngle
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ onClicked: flipable.frontClicked()
+ onLabelChanged: flipable.tagChanged(label)
+ }
+
+ back: Button {
+ id: backButton; tint: "red"; rotation: flipable.randomAngle
+ anchors { centerIn: parent; verticalCenterOffset: -20 }
+ onClicked: flipable.backClicked()
+ }
+
+ transform: Rotation {
+ origin.x: flipable.width / 2; origin.y: flipable.height / 2
+ axis.x: 0; axis.y: 1; axis.z: 0
+ angle: flipable.angle
+ }
+
+ states: State {
+ name: "back"; when: flipable.flipped
+ PropertyChanges { target: flipable; angle: 180 }
+ }
+
+ transitions: Transition {
+ ParallelAnimation {
+ NumberAnimation { properties: "angle"; duration: 400 }
+ SequentialAnimation {
+ NumberAnimation { target: flipable; property: "scale"; to: 0.8; duration: 200 }
+ NumberAnimation { target: flipable; property: "scale"; to: 1.0; duration: 200 }
+ }
+ }
+ }
+}
diff --git a/examples/demos/photoviewer/PhotoViewerCore/images/box-shadow.png b/examples/demos/photoviewer/PhotoViewerCore/images/box-shadow.png
new file mode 100644
index 0000000000..431af8545d
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/images/box-shadow.png
Binary files differ
diff --git a/examples/demos/photoviewer/PhotoViewerCore/images/busy.png b/examples/demos/photoviewer/PhotoViewerCore/images/busy.png
new file mode 100644
index 0000000000..664c2b1491
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/images/busy.png
Binary files differ
diff --git a/examples/demos/photoviewer/PhotoViewerCore/images/cardboard.png b/examples/demos/photoviewer/PhotoViewerCore/images/cardboard.png
new file mode 100644
index 0000000000..1847ab528d
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/images/cardboard.png
Binary files differ
diff --git a/examples/demos/photoviewer/PhotoViewerCore/qmldir b/examples/demos/photoviewer/PhotoViewerCore/qmldir
new file mode 100644
index 0000000000..d3c247f21a
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/qmldir
@@ -0,0 +1,8 @@
+AlbumDelegate AlbumDelegate.qml
+PhotoDelegate PhotoDelegate.qml
+ProgressBar ProgressBar.qml
+RssModel RssModel.qml
+BusyIndicator BusyIndicator.qml
+EditableButton EditableButton.qml
+Button Button.qml
+Tag Tag.qml
diff --git a/examples/demos/photoviewer/PhotoViewerCore/script/script.js b/examples/demos/photoviewer/PhotoViewerCore/script/script.js
new file mode 100644
index 0000000000..e8ef93a847
--- /dev/null
+++ b/examples/demos/photoviewer/PhotoViewerCore/script/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/demos/photoviewer/i18n/base.ts b/examples/demos/photoviewer/i18n/base.ts
new file mode 100644
index 0000000000..1accfd2f90
--- /dev/null
+++ b/examples/demos/photoviewer/i18n/base.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/demos/photoviewer/i18n/qml_fr.qm b/examples/demos/photoviewer/i18n/qml_fr.qm
new file mode 100644
index 0000000000..c24fcbc46c
--- /dev/null
+++ b/examples/demos/photoviewer/i18n/qml_fr.qm
Binary files differ
diff --git a/examples/demos/photoviewer/i18n/qml_fr.ts b/examples/demos/photoviewer/i18n/qml_fr.ts
new file mode 100644
index 0000000000..9f892db616
--- /dev/null
+++ b/examples/demos/photoviewer/i18n/qml_fr.ts
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="fr_FR">
+<context>
+ <name>AlbumDelegate</name>
+ <message>
+ <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="59"/>
+ <source>Remove</source>
+ <translation>Supprimer</translation>
+ </message>
+</context>
+<context>
+ <name>photoviewer</name>
+ <message>
+ <location filename="../photoviewer.qml" line="30"/>
+ <source>Add</source>
+ <translation>Ajouter</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="39"/>
+ <source>Edit</source>
+ <translation>Éditer</translation>
+ </message>
+ <message>
+ <location filename="../photoviewer.qml" line="52"/>
+ <source>Back</source>
+ <translation>Retour</translation>
+ </message>
+</context>
+</TS>
diff --git a/examples/demos/photoviewer/photoviewer.qml b/examples/demos/photoviewer/photoviewer.qml
new file mode 100644
index 0000000000..208720b9e6
--- /dev/null
+++ b/examples/demos/photoviewer/photoviewer.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import "PhotoViewerCore"
+
+Rectangle {
+ id: mainWindow
+
+ property real downloadProgress: 0
+ property bool imageLoading: false
+ property bool editMode: false
+
+ width: 800; height: 480; color: "#d5d6d8"
+
+ ListModel {
+ id: photosModel
+ ListElement { tag: "Flowers" }
+ ListElement { tag: "Wildlife" }
+ ListElement { tag: "Prague" }
+ }
+
+ VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} }
+
+ GridView {
+ id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220
+ model: albumVisualModel.parts.album; visible: albumsShade.opacity != 1.0
+ }
+
+ Column {
+ spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 }
+ Button {
+ id: newButton; label: qsTr("Add"); rotation: 3
+ anchors.horizontalCenter: parent.horizontalCenter
+ onClicked: {
+ mainWindow.editMode = false
+ photosModel.append( { tag: "" } )
+ albumView.positionViewAtIndex(albumView.count - 1, GridView.Contain)
+ }
+ }
+ Button {
+ id: deleteButton; label: qsTr("Edit"); rotation: -2;
+ onClicked: mainWindow.editMode = !mainWindow.editMode
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ Button {
+ id: quitButton; label: qsTr("Quit"); rotation: -2;
+ onClicked: Qt.quit()
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+
+ Rectangle {
+ id: albumsShade; color: mainWindow.color
+ width: parent.width; height: parent.height; opacity: 0.0
+ }
+
+ ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false }
+
+ Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 }
+
+ Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 }
+
+ ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false }
+
+ Item { id: foreground; anchors.fill: parent }
+
+ ProgressBar {
+ progress: mainWindow.downloadProgress; width: parent.width; height: 4
+ anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0
+ }
+}
diff --git a/examples/demos/photoviewer/photoviewer.qmlproject b/examples/demos/photoviewer/photoviewer.qmlproject
new file mode 100644
index 0000000000..600bdb10f4
--- /dev/null
+++ b/examples/demos/photoviewer/photoviewer.qmlproject
@@ -0,0 +1,20 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "photoviewer.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ Files {
+ filter: "*.ts"
+ directory: "i18n"
+ }
+}
diff --git a/examples/demos/plasmapatrol/PlasmaPatrol.qmlproject b/examples/demos/plasmapatrol/PlasmaPatrol.qmlproject
new file mode 100644
index 0000000000..548295243d
--- /dev/null
+++ b/examples/demos/plasmapatrol/PlasmaPatrol.qmlproject
@@ -0,0 +1,19 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "plasmapatrol.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+ Files {
+ paths: ["TODO"]
+ }
+}
diff --git a/examples/demos/plasmapatrol/TODO b/examples/demos/plasmapatrol/TODO
new file mode 100644
index 0000000000..ef9d21a73d
--- /dev/null
+++ b/examples/demos/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/examples/demos/plasmapatrol/content/BlasterHardpoint.qml b/examples/demos/plasmapatrol/content/BlasterHardpoint.qml
new file mode 100644
index 0000000000..10c50d43c8
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/BlasterHardpoint.qml
@@ -0,0 +1,133 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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
+ Emitter {
+ id: visualization
+ group: "blaster"
+ system: container.system
+ enabled: show
+ anchors.fill: parent
+ shape: EllipseShape {}
+ speed: TargetDirection { targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true}
+ lifeSpan: 1000
+ emitRate: 64
+
+ size: 24
+ sizeVariation: 24
+ endSize: 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;
+ }
+ }
+ Emitter {
+ id: emitter
+ group: "blaster"
+ enabled: false
+ system: container.system
+ anchors.centerIn: parent
+
+ lifeSpan: 1000
+ emitRate: 16
+ maximumEmitted: blasts
+ size: 24
+ endSize:16
+ sizeVariation: 8
+ speed: TargetDirection {
+ id: blastVector
+ targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
+ }
+ }
+}
diff --git a/examples/demos/plasmapatrol/content/Button.qml b/examples/demos/plasmapatrol/content/Button.qml
new file mode 100644
index 0000000000..992be295fc
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/Button.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+//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/examples/demos/plasmapatrol/content/CannonHardpoint.qml b/examples/demos/plasmapatrol/content/CannonHardpoint.qml
new file mode 100644
index 0000000000..48eb9d171a
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/CannonHardpoint.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: container
+ property variant target: {"y": -90, "x":12}
+ property ParticleSystem system
+ property bool show: true
+
+ width: 24
+ height: 24
+ Emitter {
+ id: visualization
+ group: "cannon"
+ enabled: container.show
+ system: container.system
+ anchors.centerIn: parent
+ lifeSpan: 2000
+ emitRate: 1
+
+ size: 4
+ endSize: 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);
+ }
+ Emitter {
+ id: emitter
+ group: "cannon"
+ enabled: false
+ system: container.system
+ anchors.centerIn: parent
+
+ lifeSpan: 1000
+ emitRate: 1
+ size: 8
+ endSize: 4
+ speed: TargetDirection {
+ id: blastVector
+ targetX: target.x; targetY: target.y; magnitude: 1.1; proportionalMagnitude: true
+ }
+ }
+}
diff --git a/examples/demos/plasmapatrol/content/ChoiceBox.qml b/examples/demos/plasmapatrol/content/ChoiceBox.qml
new file mode 100644
index 0000000000..6e21101f2e
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/ChoiceBox.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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/examples/demos/plasmapatrol/content/Cruiser.qml b/examples/demos/plasmapatrol/content/Cruiser.qml
new file mode 100644
index 0000000000..c469eb46d2
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/Cruiser.qml
@@ -0,0 +1,146 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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
+ 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
+ group: container.shipParticle
+ anchors.centerIn: parent
+ width: 64
+ height: 64
+ shape: EllipseShape {}
+
+ emitRate: hp > 0 ? hp * 1 + 20 : 0
+ lifeSpan: 2400
+ maximumEmitted: (maxHP * 1 + 20)*2.4
+
+ size: 48
+ sizeVariation: 16
+ endSize: 16
+
+ speed: AngleDirection {angleVariation:360; magnitudeVariation: 32}
+ }
+ Emitter {
+ system: container.system
+ group: "cruiserArmor"
+ anchors.fill: parent
+ shape: EllipseShape { fill: false }
+ enabled: hp>0
+
+ emitRate: 16
+ lifeSpan: 2000
+
+ size: 48
+ sizeVariation: 24
+
+ SpriteGoal {
+ id: destructor
+ system: container.system
+ enabled: container.hp <=0
+ anchors.fill: parent
+ groups: ["cruiserArmor"]
+ goalState: "death"
+// jump: true
+ once: 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/examples/demos/plasmapatrol/content/Frigate.qml b/examples/demos/plasmapatrol/content/Frigate.qml
new file mode 100644
index 0000000000..92c63b87d1
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/Frigate.qml
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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
+ Emitter {
+ system: container.system
+ group: "frigateShield"
+ anchors.centerIn: parent
+ size: 92
+ emitRate: 1
+ lifeSpan: 4800
+ enabled: hp > 0
+ }
+ Emitter {
+ system: container.system
+ group: container.shipParticle
+ anchors.centerIn: parent
+ width: 64
+ height: 16
+ shape: EllipseShape {}
+
+ size: 16
+ sizeVariation: 8
+ endSize: 8
+ emitRate: hp > 0 ? hp * 1 + 20 : 0
+ lifeSpan: 1200
+ maximumEmitted: (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/examples/demos/plasmapatrol/content/Hardpoint.qml b/examples/demos/plasmapatrol/content/Hardpoint.qml
new file mode 100644
index 0000000000..9e6057057d
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/Hardpoint.qml
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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/examples/demos/plasmapatrol/content/HelpScreens.qml b/examples/demos/plasmapatrol/content/HelpScreens.qml
new file mode 100644
index 0000000000..db70c6ee90
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/HelpScreens.qml
@@ -0,0 +1,268 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+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/examples/demos/plasmapatrol/content/LaserHardpoint.qml b/examples/demos/plasmapatrol/content/LaserHardpoint.qml
new file mode 100644
index 0000000000..a7baed604b
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/LaserHardpoint.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: container
+ property variant target: {"y": -90, "x":12}
+ property ParticleSystem system
+ property bool show: true
+
+ width: 24
+ height: 24
+ Emitter {
+ id: visualization
+ group: "laser"
+ system: container.system
+ anchors.fill: parent
+ enabled: container.show
+ shape: EllipseShape {}
+ speed: TargetDirection { targetX: width/2; targetY: width/2; magnitude: -1; proportionalMagnitude: true }
+ lifeSpan: 1000
+ emitRate: 64
+
+ size: 24
+ sizeVariation: 8
+ endSize: 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(100);
+ // 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)));
+ }
+ Emitter {
+ id: emitter
+ group: "laser"
+ enabled: 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: LineShape {
+ mirrored: (emitter.y < 0 || emitter.x < 0) && !(emitter.y < 0 && emitter.x < 0 )//I just want XOR
+ }
+
+ lifeSpan: 1000
+ emitRate: 8000
+ maximumEmitted: 800
+ size: 16
+ endSize: 0
+
+ speed: PointDirection {xVariation: 4; yVariation: 4}
+ }
+}
diff --git a/examples/demos/plasmapatrol/content/PlasmaPatrolParticles.qml b/examples/demos/plasmapatrol/content/PlasmaPatrolParticles.qml
new file mode 100644
index 0000000000..e1924c3467
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/PlasmaPatrolParticles.qml
@@ -0,0 +1,173 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ property ParticleSystem sys
+ ImageParticle {
+ system: sys
+ groups: ["default"]
+ source: "pics/blur-circle3.png"
+ color: "#003A3A3A"
+ colorVariation: 0.1
+ z: 0
+ }
+ ImageParticle {
+ system: sys
+ groups: ["redTeam"]
+ source: "pics/blur-circle3.png"
+ color: "#0028060A"
+ colorVariation: 0.1
+ z: 0
+ }
+ ImageParticle {
+ system: sys
+ groups: ["greenTeam"]
+ source: "pics/blur-circle3.png"
+ color: "#0006280A"
+ colorVariation: 0.1
+ z: 0
+ }
+ ImageParticle {
+ system: sys
+ groups: ["blaster"]
+ source: "pics/star2.png"
+ //color: "#0F282406"
+ color: "#0F484416"
+ colorVariation: 0.2
+ z: 2
+ }
+ ImageParticle {
+ system: sys
+ groups: ["laser"]
+ source: "pics/star3.png"
+ //color: "#00123F68"
+ color: "#00428FF8"
+ colorVariation: 0.2
+ z: 2
+ }
+ ImageParticle {
+ system: sys
+ groups: ["cannon"]
+ source: "pics/particle.png"
+ color: "#80FFAAFF"
+ colorVariation: 0.1
+ z: 2
+ }
+ ImageParticle {
+ system: sys
+ groups: ["cannonCore"]
+ source: "pics/particle.png"
+ color: "#00666666"
+ colorVariation: 0.8
+ z: 1
+ }
+ ImageParticle {
+ system: sys
+ groups: ["cannonWake"]
+ source: "pics/star.png"
+ color: "#00CCCCCC"
+ colorVariation: 0.2
+ z: 1
+ }
+ ImageParticle {
+ system: sys
+ groups: ["frigateShield"]
+ source: "pics/blur-circle2.png"
+ color: "#00000000"
+ colorVariation: 0.05
+ blueVariation: 0.5
+ greenVariation: 0.1
+ z: 3
+ }
+ ImageParticle {
+ system: sys
+ groups: ["cruiserArmor"]
+ z: 1
+ sprites:[Sprite {
+ id: spinState
+ name: "spinning"
+ source: "pics/meteor.png"
+ frameCount: 35
+ frameDuration: 40
+ to: {"death":0, "spinning":1}
+ },Sprite {
+ name: "death"
+ source: "pics/meteor_explo.png"
+ frameCount: 22
+ frameDuration: 40
+ to: {"null":1}
+ }, Sprite {
+ name: "null"
+ source: "pics/nullRock.png"
+ frameCount: 1
+ frameDuration: 1000
+ }
+ ]
+ }
+ TrailEmitter {
+ system: sys
+ group: "cannonWake"
+ follow: "cannon"
+ emitRatePerParticle: 64
+ lifeSpan: 600
+ speed: AngleDirection { angleVariation: 360; magnitude: 48}
+ size: 16
+ endSize: 8
+ sizeVariation: 2
+ enabled: true
+ width: 1000//XXX: Terrible hack
+ height: 1000
+ }
+ TrailEmitter {
+ system: sys
+ group: "cannonCore"
+ follow: "cannon"
+ emitRatePerParticle: 256
+ lifeSpan: 128
+ size: 24
+ endSize: 8
+ enabled: true
+ width: 1000//XXX: Terrible hack
+ height: 1000
+ }
+}
diff --git a/examples/demos/plasmapatrol/content/SequentialLoader.qml b/examples/demos/plasmapatrol/content/SequentialLoader.qml
new file mode 100644
index 0000000000..3707759ce3
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/SequentialLoader.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+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/examples/demos/plasmapatrol/content/Ship.qml b/examples/demos/plasmapatrol/content/Ship.qml
new file mode 100644
index 0000000000..bd023b1dc2
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/Ship.qml
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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/examples/demos/plasmapatrol/content/Sloop.qml b/examples/demos/plasmapatrol/content/Sloop.qml
new file mode 100644
index 0000000000..3bc58a28b0
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/Sloop.qml
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: 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
+ Emitter {
+ 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
+ group: container.shipParticle
+ shape: EllipseShape {}
+
+ emitRate: hp > 0 ? hp + 20 : 0
+ lifeSpan: blinkInterval
+ maximumEmitted: (maxHP + 20)
+
+ acceleration: AngleDirection {angleVariation: 360; magnitude: 8}
+
+ size: 24
+ endSize: 4
+ sizeVariation: 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/examples/demos/plasmapatrol/content/pics/TitleText.png b/examples/demos/plasmapatrol/content/pics/TitleText.png
new file mode 100644
index 0000000000..dc3acebe39
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/TitleText.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/blur-circle2.png b/examples/demos/plasmapatrol/content/pics/blur-circle2.png
new file mode 100644
index 0000000000..f7c9f3e98e
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/blur-circle2.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/blur-circle3.png b/examples/demos/plasmapatrol/content/pics/blur-circle3.png
new file mode 100644
index 0000000000..dbc39cb16e
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/blur-circle3.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/finalfrontier.png b/examples/demos/plasmapatrol/content/pics/finalfrontier.png
new file mode 100644
index 0000000000..2ba1815230
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/finalfrontier.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/meteor.png b/examples/demos/plasmapatrol/content/pics/meteor.png
new file mode 100644
index 0000000000..e8c368aea7
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/meteor.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/meteor_explo.png b/examples/demos/plasmapatrol/content/pics/meteor_explo.png
new file mode 100644
index 0000000000..4297245d49
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/meteor_explo.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/nullRock.png b/examples/demos/plasmapatrol/content/pics/nullRock.png
new file mode 100644
index 0000000000..4076327a1a
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/nullRock.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/particle.png b/examples/demos/plasmapatrol/content/pics/particle.png
new file mode 100644
index 0000000000..5c83896d22
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/particle.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/star.png b/examples/demos/plasmapatrol/content/pics/star.png
new file mode 100644
index 0000000000..0d592cfa87
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/star.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/star2.png b/examples/demos/plasmapatrol/content/pics/star2.png
new file mode 100644
index 0000000000..bb55c44788
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/star2.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/content/pics/star3.png b/examples/demos/plasmapatrol/content/pics/star3.png
new file mode 100644
index 0000000000..636a25f480
--- /dev/null
+++ b/examples/demos/plasmapatrol/content/pics/star3.png
Binary files differ
diff --git a/examples/demos/plasmapatrol/plasmapatrol.qml b/examples/demos/plasmapatrol/plasmapatrol.qml
new file mode 100644
index 0000000000..b14ac6385b
--- /dev/null
+++ b/examples/demos/plasmapatrol/plasmapatrol.qml
@@ -0,0 +1,386 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+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: "../images/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
+ Emitter {
+ anchors.fill: parent
+ system: particles
+ enabled: true
+ group: "default"
+ emitRate: 1200
+ lifeSpan: 1200
+ shape: MaskShape {source:"content/pics/TitleText.png"}
+ size: 16
+ endSize: 0
+ sizeVariation: 8
+ speed: AngleDirection {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/examples/demos/rssnews/content/BusyIndicator.qml b/examples/demos/rssnews/content/BusyIndicator.qml
new file mode 100644
index 0000000000..f1abd1119c
--- /dev/null
+++ b/examples/demos/rssnews/content/BusyIndicator.qml
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Image {
+ id: container
+ property bool on: false
+
+ source: "images/busy.png"; visible: container.on
+
+ NumberAnimation on rotation {
+ running: container.on; from: 0; to: 360; loops: Animation.Infinite; duration: 1200
+ }
+}
diff --git a/examples/demos/rssnews/content/CategoryDelegate.qml b/examples/demos/rssnews/content/CategoryDelegate.qml
new file mode 100644
index 0000000000..fe64238adb
--- /dev/null
+++ b/examples/demos/rssnews/content/CategoryDelegate.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: delegate
+
+ width: delegate.ListView.view.width; height: 60
+
+ Text {
+ text: name
+ color: delegate.ListView.isCurrentItem ? "white" : "black"
+ font { family: "Helvetica"; pixelSize: 16; bold: true }
+ anchors {
+ left: parent.left; leftMargin: 15
+ verticalCenter: parent.verticalCenter
+ }
+ }
+
+ BusyIndicator {
+ scale: 0.6
+ on: delegate.ListView.isCurrentItem && window.loading
+ anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter }
+ }
+
+ Rectangle {
+ width: delegate.width; height: 1; color: "#cccccc"
+ anchors.bottom: delegate.bottom
+ visible: delegate.ListView.isCurrentItem ? false : true
+ }
+ Rectangle {
+ width: delegate.width; height: 1; color: "white"
+ visible: delegate.ListView.isCurrentItem ? false : true
+ }
+
+ MouseArea {
+ anchors.fill: delegate
+ onClicked: {
+ delegate.ListView.view.currentIndex = index
+ window.currentFeed = feed
+ }
+ }
+}
diff --git a/examples/demos/rssnews/content/NewsDelegate.qml b/examples/demos/rssnews/content/NewsDelegate.qml
new file mode 100644
index 0000000000..59ab269d3b
--- /dev/null
+++ b/examples/demos/rssnews/content/NewsDelegate.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: delegate
+ height: column.height + 40
+ width: delegate.ListView.view.width
+
+ Column {
+ id: column
+ x: 20; y: 20
+ width: parent.width - 40
+
+ Text {
+ id: titleText
+ text: title; width: parent.width; wrapMode: Text.WordWrap
+ font { bold: true; family: "Helvetica"; pointSize: 16 }
+ }
+
+ Text {
+ id: descriptionText
+ width: parent.width; text: description
+ wrapMode: Text.WordWrap; font.family: "Helvetica"
+ }
+ }
+
+ Rectangle {
+ width: parent.width; height: 1; color: "#cccccc"
+ anchors.bottom: parent.bottom
+ }
+}
diff --git a/examples/demos/rssnews/content/RssFeeds.qml b/examples/demos/rssnews/content/RssFeeds.qml
new file mode 100644
index 0000000000..ed58ef3852
--- /dev/null
+++ b/examples/demos/rssnews/content/RssFeeds.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+ListModel {
+ id: rssFeeds
+
+ ListElement { name: "Top Stories"; feed: "rss.news.yahoo.com/rss/topstories" }
+ ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" }
+ ListElement { name: "Europe"; feed: "rss.news.yahoo.com/rss/europe" }
+ ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" }
+ ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" }
+ ListElement { name: "Politics"; feed: "rss.news.yahoo.com/rss/politics" }
+ ListElement { name: "Business"; feed: "rss.news.yahoo.com/rss/business" }
+ ListElement { name: "Technology"; feed: "rss.news.yahoo.com/rss/tech" }
+ ListElement { name: "Entertainment"; feed: "rss.news.yahoo.com/rss/entertainment" }
+ ListElement { name: "Health"; feed: "rss.news.yahoo.com/rss/health" }
+ ListElement { name: "Science"; feed: "rss.news.yahoo.com/rss/science" }
+ ListElement { name: "Sports"; feed: "rss.news.yahoo.com/rss/sports" }
+}
diff --git a/examples/demos/rssnews/content/ScrollBar.qml b/examples/demos/rssnews/content/ScrollBar.qml
new file mode 100644
index 0000000000..7b1a2ac3e5
--- /dev/null
+++ b/examples/demos/rssnews/content/ScrollBar.qml
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ id: container
+
+ property variant scrollArea
+ property variant orientation: Qt.Vertical
+
+ opacity: 0
+
+ function position()
+ {
+ var ny = 0;
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+ if (ny > 2) return ny; else return 2;
+ }
+
+ function size()
+ {
+ var nh, ny;
+
+ if (container.orientation == Qt.Vertical)
+ nh = scrollArea.visibleArea.heightRatio * container.height;
+ else
+ nh = scrollArea.visibleArea.widthRatio * container.width;
+
+ if (container.orientation == Qt.Vertical)
+ ny = scrollArea.visibleArea.yPosition * container.height;
+ else
+ ny = scrollArea.visibleArea.xPosition * container.width;
+
+ if (ny > 3) {
+ var t;
+ if (container.orientation == Qt.Vertical)
+ t = Math.ceil(container.height - 3 - ny);
+ else
+ t = Math.ceil(container.width - 3 - ny);
+ if (nh > t) return t; else return nh;
+ } else return nh + ny;
+ }
+
+ Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 }
+
+ BorderImage {
+ source: "images/scrollbar.png"
+ border { left: 1; right: 1; top: 1; bottom: 1 }
+ x: container.orientation == Qt.Vertical ? 2 : position()
+ width: container.orientation == Qt.Vertical ? container.width - 4 : size()
+ y: container.orientation == Qt.Vertical ? position() : 2
+ height: container.orientation == Qt.Vertical ? size() : container.height - 4
+ }
+
+ states: State {
+ name: "visible"
+ when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally
+ PropertyChanges { target: container; opacity: 1.0 }
+ }
+
+ transitions: Transition {
+ from: "visible"; to: ""
+ NumberAnimation { properties: "opacity"; duration: 600 }
+ }
+}
diff --git a/examples/demos/rssnews/content/images/busy.png b/examples/demos/rssnews/content/images/busy.png
new file mode 100644
index 0000000000..664c2b1491
--- /dev/null
+++ b/examples/demos/rssnews/content/images/busy.png
Binary files differ
diff --git a/examples/demos/rssnews/content/images/scrollbar.png b/examples/demos/rssnews/content/images/scrollbar.png
new file mode 100644
index 0000000000..0228dcf9eb
--- /dev/null
+++ b/examples/demos/rssnews/content/images/scrollbar.png
Binary files differ
diff --git a/examples/demos/rssnews/rssnews.qml b/examples/demos/rssnews/rssnews.qml
new file mode 100644
index 0000000000..d26b94b6d3
--- /dev/null
+++ b/examples/demos/rssnews/rssnews.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.XmlListModel 2.0
+import "content"
+
+Rectangle {
+ id: window
+ width: 800; height: 480
+
+ property string currentFeed: "rss.news.yahoo.com/rss/topstories"
+ property bool loading: feedModel.status == XmlListModel.Loading
+
+ RssFeeds { id: rssFeeds }
+
+ XmlListModel {
+ id: feedModel
+ source: "http://" + window.currentFeed
+ query: "/rss/channel/item"
+
+ XmlRole { name: "title"; query: "title/string()" }
+ XmlRole { name: "link"; query: "link/string()" }
+ XmlRole { name: "description"; query: "description/string()" }
+ }
+
+ Row {
+ Rectangle {
+ width: 220; height: window.height
+ color: "#efefef"
+
+ ListView {
+ focus: true
+ id: categories
+ anchors.fill: parent
+ model: rssFeeds
+ footer: quitButtonDelegate
+ delegate: CategoryDelegate {}
+ highlight: Rectangle { color: "steelblue" }
+ highlightMoveSpeed: 9999999
+ }
+ ScrollBar {
+ scrollArea: categories; height: categories.height; width: 8
+ anchors.right: categories.right
+ }
+ }
+ ListView {
+ id: list
+ width: window.width - 220; height: window.height
+ model: feedModel
+ delegate: NewsDelegate {}
+ }
+ }
+ Component {
+ id: quitButtonDelegate
+ Item {
+ width: categories.width; height: 60
+ Text {
+ text: "Quit"
+ font { family: "Helvetica"; pixelSize: 16; bold: true }
+ anchors {
+ left: parent.left; leftMargin: 15
+ verticalCenter: parent.verticalCenter
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.quit()
+ }
+ }
+ }
+ ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
+ Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" }
+}
diff --git a/examples/demos/rssnews/rssnews.qmlproject b/examples/demos/rssnews/rssnews.qmlproject
new file mode 100644
index 0000000000..5becbdaed0
--- /dev/null
+++ b/examples/demos/rssnews/rssnews.qmlproject
@@ -0,0 +1,16 @@
+import QmlProject 1.1
+
+Project {
+ mainFile: "rssnews.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+ JavaScriptFiles {
+ directory: "."
+ }
+ ImageFiles {
+ directory: "."
+ }
+}
diff --git a/examples/demos/samegame/content/BoomBlock.qml b/examples/demos/samegame/content/BoomBlock.qml
new file mode 100644
index 0000000000..a348368ae1
--- /dev/null
+++ b/examples/demos/samegame/content/BoomBlock.qml
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Particles 2.0
+
+Item {
+ id: block
+ property bool dying: false
+ property bool spawned: false
+ property int type: 0
+ property ParticleSystem particleSystem
+
+ Behavior on x {
+ enabled: spawned;
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+ Behavior on y {
+ SpringAnimation{ spring: 2; damping: 0.2 }
+ }
+
+ Image {
+ id: img
+ source: {
+ if(type == 0){
+ "pics/redStone.png";
+ } else if(type == 1) {
+ "pics/blueStone.png";
+ } else {
+ "pics/greenStone.png";
+ }
+ }
+ opacity: 0
+ Behavior on opacity { NumberAnimation { duration: 200 } }
+ anchors.fill: parent
+ }
+ Emitter {
+ id: particles
+ system: particleSystem
+ group: {
+ if(type == 0){
+ "red";
+ } else if (type == 1) {
+ "blue";
+ } else {
+ "green";
+ }
+ }
+ anchors.fill: parent
+
+ speed: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ shape: EllipseShape{fill:true}
+ enabled: false;
+ lifeSpan: 700; lifeSpanVariation: 100
+ emitRate: 1000
+ maximumEmitted: 100 //only fires 0.1s bursts (still 2x old number)
+ size: 28
+ endSize: 14
+ }
+
+ states: [
+ State {
+ name: "AliveState"; when: spawned == true && dying == false
+ PropertyChanges { target: img; opacity: 1 }
+ },
+
+ State {
+ name: "DeathState"; when: dying == true
+ StateChangeScript { script: {particleSystem.paused = false; particles.pulse(100);} }
+ PropertyChanges { target: img; opacity: 0 }
+ StateChangeScript { script: block.destroy(1000); }
+ }
+ ]
+}
diff --git a/examples/demos/samegame/content/Button.qml b/examples/demos/samegame/content/Button.qml
new file mode 100644
index 0000000000..2d1a993226
--- /dev/null
+++ b/examples/demos/samegame/content/Button.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: container
+
+ property string text: "Button"
+
+ signal clicked
+
+ width: buttonLabel.width + 20; height: buttonLabel.height + 20
+ smooth: true
+ border { width: 1; color: Qt.darker(activePalette.button) }
+ radius: 8
+ color: activePalette.button
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: {
+ if (mouseArea.pressed)
+ return activePalette.dark
+ else
+ return activePalette.light
+ }
+ }
+ GradientStop { position: 1.0; color: activePalette.button }
+ }
+
+ MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() }
+
+ Text {
+ id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText; font.pixelSize: 24
+ }
+}
diff --git a/examples/demos/samegame/content/Dialog.qml b/examples/demos/samegame/content/Dialog.qml
new file mode 100644
index 0000000000..c81580e6a5
--- /dev/null
+++ b/examples/demos/samegame/content/Dialog.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: page
+ anchors.centerIn: parent
+
+ property Item text: dialogText
+ property bool open: false
+
+ signal closed
+ signal opened
+ function forceClose() {
+ 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;
+ }
+
+ width: dialogText.width + 20; height: dialogText.height + 20
+ color: "white"
+ border.width: 1
+ opacity: 0
+ visible: opacity > 0
+ Behavior on opacity {
+ NumberAnimation { duration: 1000 }
+ }
+
+ Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" }
+
+ MouseArea { anchors.fill: parent; onClicked: forceClose(); }
+}
+
diff --git a/examples/demos/samegame/content/GameArea.qml b/examples/demos/samegame/content/GameArea.qml
new file mode 100644
index 0000000000..3422582b21
--- /dev/null
+++ b/examples/demos/samegame/content/GameArea.qml
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+**