summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2018-06-16 10:32:34 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-07-12 20:23:24 +0000
commitfa3c840ef1ff2100ccca6866528ac1f008c8e3a7 (patch)
treef5f54c46a177e8a6041796da99108e515e402526 /examples
parent6c1ce43ce6399d7e40f4c57d3c9ca543ab760980 (diff)
Move demos to qtdoc repository
These demos use several modules and moving them allows to use for example Qt Quick Controls 2 in them. Change-Id: I1f352671dec672665e9fdb6a9c2a7c6e25a002b0 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.pro19
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.qml173
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.qmlproject16
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.qrc12
-rw-r--r--examples/quick/demos/calqlatr/content/Button.qml104
-rw-r--r--examples/quick/demos/calqlatr/content/Display.qml203
-rw-r--r--examples/quick/demos/calqlatr/content/NumberPad.qml81
-rw-r--r--examples/quick/demos/calqlatr/content/calculator.js161
-rw-r--r--examples/quick/demos/calqlatr/content/images/paper-edge-left.pngbin12401 -> 0 bytes
-rw-r--r--examples/quick/demos/calqlatr/content/images/paper-edge-right.pngbin12967 -> 0 bytes
-rw-r--r--examples/quick/demos/calqlatr/content/images/paper-grip.pngbin298 -> 0 bytes
-rw-r--r--examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.pngbin37120 -> 0 bytes
-rw-r--r--examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc195
-rw-r--r--examples/quick/demos/calqlatr/main.cpp51
-rw-r--r--examples/quick/demos/clocks/clocks.pro14
-rw-r--r--examples/quick/demos/clocks/clocks.qml98
-rw-r--r--examples/quick/demos/clocks/clocks.qmlproject8
-rw-r--r--examples/quick/demos/clocks/clocks.qrc15
-rw-r--r--examples/quick/demos/clocks/content/Clock.qml150
-rw-r--r--examples/quick/demos/clocks/content/arrow.pngbin692 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/background.pngbin46895 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/center.pngbin765 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/clock-night.pngbin23359 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/clock.pngbin20653 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/hour.pngbin518 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/minute.pngbin528 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/quit.pngbin583 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/content/second.pngbin231 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.pngbin26067 -> 0 bytes
-rw-r--r--examples/quick/demos/clocks/doc/src/clocks.qdoc127
-rw-r--r--examples/quick/demos/clocks/main.cpp51
-rw-r--r--examples/quick/demos/demos.pro11
-rw-r--r--examples/quick/demos/maroon/content/BuildButton.qml100
-rw-r--r--examples/quick/demos/maroon/content/GameCanvas.qml250
-rw-r--r--examples/quick/demos/maroon/content/GameOverScreen.qml125
-rw-r--r--examples/quick/demos/maroon/content/InfoBar.qml94
-rw-r--r--examples/quick/demos/maroon/content/NewGameScreen.qml121
-rw-r--r--examples/quick/demos/maroon/content/SoundEffect.qml62
-rw-r--r--examples/quick/demos/maroon/content/audio/bomb-action.wavbin20972 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/catch-action.wavbin13274 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/catch.wavbin8638 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/currency.wavbin15790 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/factory-action.wavbin4936 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/melee-action.wavbin17798 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/projectile-action.wavbin2562 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/audio/shooter-action.wavbin27554 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/background.pngbin5802 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/bomb-action.pngbin23974 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/bomb-idle.pngbin12238 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/bomb.pngbin4067 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/button-help.pngbin8916 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/button-play.pngbin13945 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/catch-action.pngbin6760 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/catch.pngbin4771 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/cloud.pngbin3398 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/currency.pngbin1889 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/dialog-bomb.pngbin3751 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/dialog-factory.pngbin3946 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/dialog-melee.pngbin4392 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/dialog-pointer.pngbin911 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/dialog-shooter.pngbin3737 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/dialog.pngbin3362 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/factory-action.pngbin22440 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/factory-idle.pngbin12729 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/factory.pngbin4138 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/grid.pngbin2830 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/help.pngbin38255 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/lifes.pngbin1675 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/logo-bubble.pngbin7706 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/logo-fish.pngbin3477 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/logo.pngbin18332 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/melee-action.pngbin7797 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/melee-idle.pngbin22832 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/melee.pngbin4046 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/mob-idle.pngbin6181 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/mob.pngbin2391 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/points.pngbin1561 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/projectile-action.pngbin6257 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/projectile.pngbin801 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/scores.pngbin1535 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/shooter-action.pngbin18121 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/shooter-idle.pngbin11929 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/shooter.pngbin4137 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/sunlight.pngbin248412 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/text-1.pngbin2777 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/text-2.pngbin4959 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/text-3.pngbin5063 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/text-blank.pngbin1326 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/text-gameover.pngbin1515 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/text-go.pngbin4230 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/gfx/wave.pngbin2763 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/content/logic.js274
-rw-r--r--examples/quick/demos/maroon/content/mobs/MobBase.qml272
-rw-r--r--examples/quick/demos/maroon/content/towers/Bomb.qml143
-rw-r--r--examples/quick/demos/maroon/content/towers/Factory.qml124
-rw-r--r--examples/quick/demos/maroon/content/towers/Melee.qml93
-rw-r--r--examples/quick/demos/maroon/content/towers/Ranged.qml138
-rw-r--r--examples/quick/demos/maroon/content/towers/TowerBase.qml82
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.pngbin73390 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.pngbin61303 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpgbin25541 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpgbin79678 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpgbin27911 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpgbin59198 -> 0 bytes
-rw-r--r--examples/quick/demos/maroon/doc/src/maroon.qdoc889
-rw-r--r--examples/quick/demos/maroon/main.cpp51
-rw-r--r--examples/quick/demos/maroon/maroon.pro9
-rw-r--r--examples/quick/demos/maroon/maroon.qml245
-rw-r--r--examples/quick/demos/maroon/maroon.qmlproject16
-rw-r--r--examples/quick/demos/maroon/maroon.qrc71
-rw-r--r--examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.pngbin47271 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/doc/src/photosurface.qdoc157
-rw-r--r--examples/quick/demos/photosurface/main.cpp139
-rw-r--r--examples/quick/demos/photosurface/photosurface.pro13
-rw-r--r--examples/quick/demos/photosurface/photosurface.qml286
-rw-r--r--examples/quick/demos/photosurface/photosurface.qmlproject20
-rw-r--r--examples/quick/demos/photosurface/photosurface.qrc6
-rw-r--r--examples/quick/demos/photosurface/resources/folder.pngbin5851 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/icon.pngbin35894 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/photosurface.icnsbin47407 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/photosurface.icobin38623 -> 0 bytes
-rw-r--r--examples/quick/demos/photosurface/resources/photosurface.rc32
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml157
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml59
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/Button.qml81
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/EditableButton.qml94
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml198
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/ProgressBar.qml66
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/RssModel.qml66
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/Tag.qml100
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.pngbin371 -> 0 bytes
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.pngbin1564 -> 0 bytes
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.pngbin8477 -> 0 bytes
-rw-r--r--examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js27
-rw-r--r--examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.pngbin73662 -> 0 bytes
-rw-r--r--examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc326
-rw-r--r--examples/quick/demos/photoviewer/i18n/qml_de.qmbin310 -> 0 bytes
-rw-r--r--examples/quick/demos/photoviewer/i18n/qml_de.ts35
-rw-r--r--examples/quick/demos/photoviewer/i18n/qml_fr.qmbin247 -> 0 bytes
-rw-r--r--examples/quick/demos/photoviewer/i18n/qml_fr.ts35
-rw-r--r--examples/quick/demos/photoviewer/main.cpp68
-rw-r--r--examples/quick/demos/photoviewer/main.qml139
-rw-r--r--examples/quick/demos/photoviewer/photoviewer.pro19
-rw-r--r--examples/quick/demos/photoviewer/qml.qrc19
-rw-r--r--examples/quick/demos/rssnews/content/BusyIndicator.qml64
-rw-r--r--examples/quick/demos/rssnews/content/CategoryDelegate.qml99
-rw-r--r--examples/quick/demos/rssnews/content/NewsDelegate.qml140
-rw-r--r--examples/quick/demos/rssnews/content/RssFeeds.qml66
-rw-r--r--examples/quick/demos/rssnews/content/ScrollBar.qml126
-rw-r--r--examples/quick/demos/rssnews/content/images/Asia.jpgbin10578 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Business.jpgbin17276 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Entertainment.jpgbin15433 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Europe.jpgbin15872 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Health.jpgbin16015 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Politics.jpgbin16401 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Science.jpgbin9496 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Sports.jpgbin9281 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/Technology.jpgbin22290 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/TopStories.jpgbin8067 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/USNational.jpgbin9635 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/World.jpgbin15128 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/btn_close.pngbin328 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/busy.pngbin1564 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/content/images/scrollbar.pngbin79 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.pngbin56830 -> 0 bytes
-rw-r--r--examples/quick/demos/rssnews/doc/src/rssnews.qdoc372
-rw-r--r--examples/quick/demos/rssnews/main.cpp51
-rw-r--r--examples/quick/demos/rssnews/rssnews.pro13
-rw-r--r--examples/quick/demos/rssnews/rssnews.qml169
-rw-r--r--examples/quick/demos/rssnews/rssnews.qmlproject16
-rw-r--r--examples/quick/demos/rssnews/rssnews.qrc25
-rw-r--r--examples/quick/demos/samegame/content/Block.qml124
-rw-r--r--examples/quick/demos/samegame/content/BlockEmitter.qml67
-rw-r--r--examples/quick/demos/samegame/content/Button.qml80
-rw-r--r--examples/quick/demos/samegame/content/GameArea.qml238
-rw-r--r--examples/quick/demos/samegame/content/LogoAnimation.qml112
-rw-r--r--examples/quick/demos/samegame/content/MenuEmitter.qml63
-rw-r--r--examples/quick/demos/samegame/content/PaintEmitter.qml108
-rw-r--r--examples/quick/demos/samegame/content/PrimaryPack.qml132
-rw-r--r--examples/quick/demos/samegame/content/PuzzleBlock.qml121
-rw-r--r--examples/quick/demos/samegame/content/SamegameText.qml59
-rw-r--r--examples/quick/demos/samegame/content/Settings.qml70
-rw-r--r--examples/quick/demos/samegame/content/SimpleBlock.qml118
-rw-r--r--examples/quick/demos/samegame/content/SmokeText.qml93
-rw-r--r--examples/quick/demos/samegame/content/gfx/background-puzzle.pngbin86666 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/background.pngbin101018 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/bar.pngbin10970 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/blue-puzzle.pngbin2219 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/blue.pngbin1018 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/bubble-highscore.pngbin2276 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/bubble-puzzle.pngbin2811 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-game-1.pngbin2728 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-game-2.pngbin3378 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-game-3.pngbin1423 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-game-4.pngbin2096 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-game-new.pngbin3662 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-menu.pngbin2391 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-puzzle-next.pngbin3658 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/but-quit.pngbin2100 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/green-puzzle.pngbin2271 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/green.pngbin1024 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/icon-fail.pngbin6549 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/icon-ok.pngbin7190 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/icon-time.pngbin1159 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/logo-a.pngbin1814 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/logo-e.pngbin1725 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/logo-g.pngbin1765 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/logo-m.pngbin1743 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/logo-s.pngbin1791 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/logo.pngbin3608 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/particle-brick.pngbin861 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/particle-paint.pngbin714 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/particle-smoke.pngbin5409 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/red-puzzle.pngbin2218 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/red.pngbin1018 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-highscore-new.pngbin6767 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-highscore.pngbin3179 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-no-winner.pngbin6321 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-p1-go.pngbin5395 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-p1-won.pngbin5618 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-p1.pngbin1751 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-p2-go.pngbin5874 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-p2-won.pngbin6177 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/text-p2.pngbin2381 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/yellow-puzzle.pngbin2239 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/gfx/yellow.pngbin1008 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/content/levels/TemplateBase.qml80
-rw-r--r--examples/quick/demos/samegame/content/levels/level0.qml69
-rw-r--r--examples/quick/demos/samegame/content/levels/level1.qml69
-rw-r--r--examples/quick/demos/samegame/content/levels/level2.qml71
-rw-r--r--examples/quick/demos/samegame/content/levels/level3.qml70
-rw-r--r--examples/quick/demos/samegame/content/levels/level4.qml68
-rw-r--r--examples/quick/demos/samegame/content/levels/level5.qml69
-rw-r--r--examples/quick/demos/samegame/content/levels/level6.qml70
-rw-r--r--examples/quick/demos/samegame/content/levels/level7.qml68
-rw-r--r--examples/quick/demos/samegame/content/levels/level8.qml69
-rw-r--r--examples/quick/demos/samegame/content/levels/level9.qml72
-rw-r--r--examples/quick/demos/samegame/content/qmldir13
-rw-r--r--examples/quick/demos/samegame/content/samegame.js590
-rw-r--r--examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.pngbin100713 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.pngbin134892 -> 0 bytes
-rw-r--r--examples/quick/demos/samegame/doc/src/samegame.qdoc47
-rw-r--r--examples/quick/demos/samegame/main.cpp51
-rw-r--r--examples/quick/demos/samegame/samegame.pro8
-rw-r--r--examples/quick/demos/samegame/samegame.qml382
-rw-r--r--examples/quick/demos/samegame/samegame.qmlproject16
-rw-r--r--examples/quick/demos/samegame/samegame.qrc73
-rw-r--r--examples/quick/demos/stocqt/content/+windows/Settings.qml56
-rw-r--r--examples/quick/demos/stocqt/content/Banner.qml96
-rw-r--r--examples/quick/demos/stocqt/content/Button.qml74
-rw-r--r--examples/quick/demos/stocqt/content/CheckBox.qml86
-rw-r--r--examples/quick/demos/stocqt/content/Settings.qml56
-rw-r--r--examples/quick/demos/stocqt/content/StockChart.qml400
-rw-r--r--examples/quick/demos/stocqt/content/StockInfo.qml130
-rw-r--r--examples/quick/demos/stocqt/content/StockListDelegate.qml163
-rw-r--r--examples/quick/demos/stocqt/content/StockListModel.qml130
-rw-r--r--examples/quick/demos/stocqt/content/StockListView.qml88
-rw-r--r--examples/quick/demos/stocqt/content/StockModel.qml148
-rw-r--r--examples/quick/demos/stocqt/content/StockSettingsPanel.qml163
-rw-r--r--examples/quick/demos/stocqt/content/StockView.qml110
-rw-r--r--examples/quick/demos/stocqt/content/data/AAPL.csv147
-rw-r--r--examples/quick/demos/stocqt/content/data/ADSK.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/AMD.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/AMZN.csv147
-rw-r--r--examples/quick/demos/stocqt/content/data/CSCO.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/EA.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/EBAY.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/FB.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/GOOG.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/GOOGL.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/INTC.csv147
-rw-r--r--examples/quick/demos/stocqt/content/data/MSFT.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/NCLH.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/NFLX.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/NTAP.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/NVDA.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/PYPL.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/QCOM.csv147
-rw-r--r--examples/quick/demos/stocqt/content/data/TSLA.csv148
-rw-r--r--examples/quick/demos/stocqt/content/data/TXN.csv148
-rw-r--r--examples/quick/demos/stocqt/content/images/icon-left-arrow.pngbin358 -> 0 bytes
-rw-r--r--examples/quick/demos/stocqt/content/images/wheel-touch.pngbin4767 -> 0 bytes
-rw-r--r--examples/quick/demos/stocqt/content/images/wheel.pngbin36223 -> 0 bytes
-rw-r--r--examples/quick/demos/stocqt/content/qmldir12
-rw-r--r--examples/quick/demos/stocqt/doc/images/qtquick-demo-stocqt.pngbin27425 -> 0 bytes
-rw-r--r--examples/quick/demos/stocqt/doc/src/stocqt.qdoc85
-rw-r--r--examples/quick/demos/stocqt/main.cpp51
-rw-r--r--examples/quick/demos/stocqt/stocqt.pro9
-rw-r--r--examples/quick/demos/stocqt/stocqt.qml110
-rw-r--r--examples/quick/demos/stocqt/stocqt.qmlproject16
-rw-r--r--examples/quick/demos/stocqt/stocqt.qrc42
-rw-r--r--examples/quick/demos/tweetsearch/content/FlipBar.qml183
-rw-r--r--examples/quick/demos/tweetsearch/content/LineInput.qml108
-rw-r--r--examples/quick/demos/tweetsearch/content/ListFooter.qml164
-rw-r--r--examples/quick/demos/tweetsearch/content/ListHeader.qml91
-rw-r--r--examples/quick/demos/tweetsearch/content/SearchDelegate.qml135
-rw-r--r--examples/quick/demos/tweetsearch/content/TweetDelegate.qml199
-rw-r--r--examples/quick/demos/tweetsearch/content/TweetsModel.qml135
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/anonymous.pngbin1788 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/bird-anim-sprites.pngbin11079 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-clear.pngbin1166 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-loading.pngbin1542 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-refresh.pngbin1202 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/resources/icon-search.pngbin1284 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/content/tweetsearch.js62
-rw-r--r--examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-1.pngbin18531 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/doc/images/qtquick-demo-tweetsearch-med-2.pngbin90622 -> 0 bytes
-rw-r--r--examples/quick/demos/tweetsearch/doc/src/tweetsearch.qdoc79
-rw-r--r--examples/quick/demos/tweetsearch/main.cpp51
-rw-r--r--examples/quick/demos/tweetsearch/tweetsearch.pro13
-rw-r--r--examples/quick/demos/tweetsearch/tweetsearch.qml142
-rw-r--r--examples/quick/demos/tweetsearch/tweetsearch.qmlproject16
-rw-r--r--examples/quick/demos/tweetsearch/tweetsearch.qrc19
-rw-r--r--examples/quick/quick.pro3
314 files changed, 1 insertions, 17651 deletions
diff --git a/examples/quick/demos/calqlatr/calqlatr.pro b/examples/quick/demos/calqlatr/calqlatr.pro
deleted file mode 100644
index 20543c08da..0000000000
--- a/examples/quick/demos/calqlatr/calqlatr.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick
-SOURCES += main.cpp
-
-RESOURCES += calqlatr.qrc \
- ../../shared/shared.qrc
-
-OTHER_FILES = calqlatr.qml \
- content/Button.qml \
- content/Display.qml \
- content/NumberPad.qml \
- content/calculator.js \
- content/images/paper-edge-left.png \
- content/images/paper-edge-right.png \
- content/images/paper-grip.png
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/calqlatr
-INSTALLS += target
diff --git a/examples/quick/demos/calqlatr/calqlatr.qml b/examples/quick/demos/calqlatr/calqlatr.qml
deleted file mode 100644
index 769513b7bd..0000000000
--- a/examples/quick/demos/calqlatr/calqlatr.qml
+++ /dev/null
@@ -1,173 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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"
-import "content/calculator.js" as CalcEngine
-
-
-Rectangle {
- id: window
- width: 320
- height: 480
- focus: true
- color: "#272822"
-
- onWidthChanged: controller.reload()
- onHeightChanged: controller.reload()
-
- function operatorPressed(operator) {
- CalcEngine.operatorPressed(operator)
- numPad.buttonPressed()
- }
- function digitPressed(digit) {
- CalcEngine.digitPressed(digit)
- numPad.buttonPressed()
- }
- function isButtonDisabled(op) {
- return CalcEngine.disabled(op)
- }
-
- Item {
- id: pad
- width: 180
- NumberPad { id: numPad; y: 10; anchors.horizontalCenter: parent.horizontalCenter }
- }
-
- AnimationController {
- id: controller
- animation: ParallelAnimation {
- id: anim
- NumberAnimation { target: display; property: "x"; duration: 400; from: -16; to: window.width - display.width; easing.type: Easing.InOutQuad }
- NumberAnimation { target: pad; property: "x"; duration: 400; from: window.width - pad.width; to: 0; easing.type: Easing.InOutQuad }
- SequentialAnimation {
- NumberAnimation { target: pad; property: "scale"; duration: 200; from: 1; to: 0.97; easing.type: Easing.InOutQuad }
- NumberAnimation { target: pad; property: "scale"; duration: 200; from: 0.97; to: 1; easing.type: Easing.InOutQuad }
- }
- }
- }
-
- Keys.onPressed: {
- if (event.key == Qt.Key_0)
- digitPressed("0")
- else if (event.key == Qt.Key_1)
- digitPressed("1")
- else if (event.key == Qt.Key_2)
- digitPressed("2")
- else if (event.key == Qt.Key_3)
- digitPressed("3")
- else if (event.key == Qt.Key_4)
- digitPressed("4")
- else if (event.key == Qt.Key_5)
- digitPressed("5")
- else if (event.key == Qt.Key_6)
- digitPressed("6")
- else if (event.key == Qt.Key_7)
- digitPressed("7")
- else if (event.key == Qt.Key_8)
- digitPressed("8")
- else if (event.key == Qt.Key_9)
- digitPressed("9")
- else if (event.key == Qt.Key_Plus)
- operatorPressed("+")
- else if (event.key == Qt.Key_Minus)
- operatorPressed("−")
- else if (event.key == Qt.Key_Asterisk)
- operatorPressed("×")
- else if (event.key == Qt.Key_Slash)
- operatorPressed("÷")
- else if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return)
- operatorPressed("=")
- else if (event.key == Qt.Key_Comma || event.key == Qt.Key_Period)
- digitPressed(".")
- else if (event.key == Qt.Key_Backspace)
- operatorPressed("backspace")
- }
-
- Display {
- id: display
- x: -16
- width: window.width - pad.width
- height: parent.height
-
- MouseArea {
- id: mouseInput
- property real startX: 0
- property real oldP: 0
- property bool rewind: false
-
- anchors {
- bottom: parent.bottom
- left: parent.left
- right: parent.right
- }
- height: 50
- onPositionChanged: {
- var reverse = startX > window.width / 2
- var mx = mapToItem(window, mouseInput.mouseX, mouseInput.mouseY).x
- var p = Math.abs((mx - startX) / (window.width - display.width))
- if (p < oldP)
- rewind = reverse ? false : true
- else
- rewind = reverse ? true : false
- controller.progress = reverse ? 1 - p : p
- oldP = p
- }
- onPressed: startX = mapToItem(window, mouseInput.mouseX, mouseInput.mouseY).x
- onReleased: {
- if (rewind)
- controller.completeToBeginning()
- else
- controller.completeToEnd()
- }
- }
- }
-
-}
diff --git a/examples/quick/demos/calqlatr/calqlatr.qmlproject b/examples/quick/demos/calqlatr/calqlatr.qmlproject
deleted file mode 100644
index ce2d59d310..0000000000
--- a/examples/quick/demos/calqlatr/calqlatr.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "calqlatr.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-}
diff --git a/examples/quick/demos/calqlatr/calqlatr.qrc b/examples/quick/demos/calqlatr/calqlatr.qrc
deleted file mode 100644
index 7483304e02..0000000000
--- a/examples/quick/demos/calqlatr/calqlatr.qrc
+++ /dev/null
@@ -1,12 +0,0 @@
-<RCC>
- <qresource prefix="/demos/calqlatr">
- <file>calqlatr.qml</file>
- <file>content/Button.qml</file>
- <file>content/calculator.js</file>
- <file>content/Display.qml</file>
- <file>content/NumberPad.qml</file>
- <file>content/images/paper-edge-left.png</file>
- <file>content/images/paper-edge-right.png</file>
- <file>content/images/paper-grip.png</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/calqlatr/content/Button.qml b/examples/quick/demos/calqlatr/content/Button.qml
deleted file mode 100644
index 5279596ef1..0000000000
--- a/examples/quick/demos/calqlatr/content/Button.qml
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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: button
- property alias text: textItem.text
- property color color: "#eceeea"
-
- property bool operator: false
- property bool dimmable: false
- property bool dimmed: false
-
- width: 30
- height: 50
-
- Text {
- id: textItem
- font.pixelSize: 48
- wrapMode: Text.WordWrap
- lineHeight: 0.75
- color: (dimmable && dimmed) ? Qt.darker(button.color) : button.color
- Behavior on color { ColorAnimation { duration: 120; easing.type: Easing.OutElastic} }
- states: [
- State {
- name: "pressed"
- when: mouse.pressed && !dimmed
- PropertyChanges {
- target: textItem
- color: Qt.lighter(button.color)
- }
- }
- ]
- }
-
- MouseArea {
- id: mouse
- anchors.fill: parent
- anchors.margins: -5
- onClicked: {
- if (operator)
- window.operatorPressed(parent.text)
- else
- window.digitPressed(parent.text)
- }
- }
-
- function updateDimmed() {
- dimmed = window.isButtonDisabled(button.text)
- }
-
- Component.onCompleted: {
- numPad.buttonPressed.connect(updateDimmed)
- updateDimmed()
- }
-}
diff --git a/examples/quick/demos/calqlatr/content/Display.qml b/examples/quick/demos/calqlatr/content/Display.qml
deleted file mode 100644
index 9ddd64d251..0000000000
--- a/examples/quick/demos/calqlatr/content/Display.qml
+++ /dev/null
@@ -1,203 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Window 2.0
-
-Item {
- id: display
- property real fontSize: Math.floor(Screen.pixelDensity * 5.0)
- property bool enteringDigits: false
- property int maxDigits: (width / fontSize) + 1
- property string displayedOperand
- property string errorString: qsTr("ERROR")
- property bool isError: displayedOperand === errorString
-
- function displayOperator(operator)
- {
- listView.model.append({ "operator": operator, "operand": "" })
- enteringDigits = true
- listView.positionViewAtEnd()
- }
-
- function newLine(operator, operand)
- {
- displayedOperand = displayNumber(operand)
- listView.model.append({ "operator": operator, "operand": displayedOperand })
- enteringDigits = false
- listView.positionViewAtEnd()
- }
-
- function appendDigit(digit)
- {
- if (!enteringDigits)
- listView.model.append({ "operator": "", "operand": "" })
- var i = listView.model.count - 1;
- listView.model.get(i).operand = listView.model.get(i).operand + digit;
- enteringDigits = true
- listView.positionViewAtEnd()
- }
-
- function setDigit(digit)
- {
- var i = listView.model.count - 1;
- listView.model.get(i).operand = digit;
- listView.positionViewAtEnd()
- }
-
- function clear()
- {
- displayedOperand = ""
- if (enteringDigits) {
- var i = listView.model.count - 1
- if (i >= 0)
- listView.model.remove(i)
- enteringDigits = false
- }
- }
-
- // Returns a string representation of a number that fits in
- // display.maxDigits characters, trying to keep as much precision
- // as possible. If the number cannot be displayed, returns an
- // error string.
- function displayNumber(num) {
- if (typeof(num) != "number")
- return errorString;
-
- var intNum = parseInt(num);
- var intLen = intNum.toString().length;
-
- // Do not count the minus sign as a digit
- var maxLen = num < 0 ? maxDigits + 1 : maxDigits;
-
- if (num.toString().length <= maxLen) {
- if (isFinite(num))
- return num.toString();
- return errorString;
- }
-
- // Integer part of the number is too long - try
- // an exponential notation
- if (intNum == num || intLen > maxLen - 3) {
- var expVal = num.toExponential(maxDigits - 6).toString();
- if (expVal.length <= maxLen)
- return expVal;
- }
-
- // Try a float presentation with fixed number of digits
- var floatStr = parseFloat(num).toFixed(maxDigits - intLen - 1).toString();
- if (floatStr.length <= maxLen)
- return floatStr;
-
- return errorString;
- }
-
- Item {
- id: theItem
- width: parent.width + 32
- height: parent.height
-
- Rectangle {
- id: rect
- x: 16
- color: "white"
- height: parent.height
- width: display.width - 16
- }
- Image {
- anchors.right: rect.left
- source: "images/paper-edge-left.png"
- height: parent.height
- fillMode: Image.TileVertically
- }
- Image {
- anchors.left: rect.right
- source: "images/paper-edge-right.png"
- height: parent.height
- fillMode: Image.TileVertically
- }
-
- Image {
- id: grip
- source: "images/paper-grip.png"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 20
- }
-
- ListView {
- id: listView
- x: 16; y: 30
- width: display.width
- height: display.height - 50 - y
- delegate: Item {
- height: display.fontSize * 1.1
- width: parent.width
- Text {
- id: operator
- x: 6
- font.pixelSize: display.fontSize
- color: "#6da43d"
- text: model.operator
- }
- Text {
- id: operand
- font.pixelSize: display.fontSize
- anchors.right: parent.right
- anchors.rightMargin: 22
- text: model.operand
- }
- }
- model: ListModel { }
- }
-
- }
-
-}
diff --git a/examples/quick/demos/calqlatr/content/NumberPad.qml b/examples/quick/demos/calqlatr/content/NumberPad.qml
deleted file mode 100644
index 9936116fa1..0000000000
--- a/examples/quick/demos/calqlatr/content/NumberPad.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-Grid {
- columns: 3
- columnSpacing: 32
- rowSpacing: 16
-
- signal buttonPressed
-
- Button { text: "7" }
- Button { text: "8" }
- Button { text: "9" }
- Button { text: "4" }
- Button { text: "5" }
- Button { text: "6" }
- Button { text: "1" }
- Button { text: "2" }
- Button { text: "3" }
- Button { text: "0" }
- Button { text: "."; dimmable: true }
- Button { text: " " }
- Button { text: "±"; color: "#6da43d"; operator: true; dimmable: true }
- Button { text: "−"; color: "#6da43d"; operator: true; dimmable: true }
- Button { text: "+"; color: "#6da43d"; operator: true; dimmable: true }
- Button { text: "√"; color: "#6da43d"; operator: true; dimmable: true }
- Button { text: "÷"; color: "#6da43d"; operator: true; dimmable: true }
- Button { text: "×"; color: "#6da43d"; operator: true; dimmable: true }
- Button { text: "C"; color: "#6da43d"; operator: true }
- Button { text: " "; color: "#6da43d"; operator: true }
- Button { text: "="; color: "#6da43d"; operator: true; dimmable: true }
-}
diff --git a/examples/quick/demos/calqlatr/content/calculator.js b/examples/quick/demos/calqlatr/content/calculator.js
deleted file mode 100644
index 37eb752191..0000000000
--- a/examples/quick/demos/calqlatr/content/calculator.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-var curVal = 0
-var memory = 0
-var lastOp = ""
-var previousOperator = ""
-var digits = ""
-
-function disabled(op) {
- if (digits == "" && !((op >= "0" && op <= "9") || op == "."))
- return true
- else if (op == '=' && previousOperator.length != 1)
- return true
- else if (op == "." && digits.toString().search(/\./) != -1) {
- return true
- } else if (op == "√" && digits.toString().search(/-/) != -1) {
- return true
- } else {
- return false
- }
-}
-
-function digitPressed(op)
-{
- if (disabled(op))
- return
- if (digits.toString().length >= display.maxDigits)
- return
- if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) {
- digits = digits + op.toString()
- display.appendDigit(op.toString())
- } else {
- digits = op
- display.appendDigit(op.toString())
- }
- lastOp = op
-}
-
-function operatorPressed(op)
-{
- if (disabled(op))
- return
- lastOp = op
-
- if (op == "±") {
- digits = Number(digits.valueOf() * -1)
- display.setDigit(display.displayNumber(digits))
- return
- }
-
- if (previousOperator == "+") {
- digits = Number(digits.valueOf()) + Number(curVal.valueOf())
- } else if (previousOperator == "−") {
- digits = Number(curVal.valueOf()) - Number(digits.valueOf())
- } else if (previousOperator == "×") {
- digits = Number(curVal) * Number(digits.valueOf())
- } else if (previousOperator == "÷") {
- digits = Number(curVal) / Number(digits.valueOf())
- }
-
- if (op == "+" || op == "−" || op == "×" || op == "÷") {
- previousOperator = op
- curVal = digits.valueOf()
- digits = ""
- display.displayOperator(previousOperator)
- return
- }
-
- if (op == "=") {
- display.newLine("=", digits.valueOf())
- }
-
- curVal = 0
- previousOperator = ""
-
- if (op == "1/x") {
- digits = (1 / digits.valueOf()).toString()
- } else if (op == "x^2") {
- digits = (digits.valueOf() * digits.valueOf()).toString()
- } else if (op == "Abs") {
- digits = (Math.abs(digits.valueOf())).toString()
- } else if (op == "Int") {
- digits = (Math.floor(digits.valueOf())).toString()
- } else if (op == "√") {
- digits = Number(Math.sqrt(digits.valueOf()))
- display.newLine("√", digits.valueOf())
- } else if (op == "mc") {
- memory = 0;
- } else if (op == "m+") {
- memory += digits.valueOf()
- } else if (op == "mr") {
- digits = memory.toString()
- } else if (op == "m-") {
- memory = digits.valueOf()
- } else if (op == "backspace") {
- digits = digits.toString().slice(0, -1)
- display.clear()
- display.appendDigit(digits)
- } else if (op == "Off") {
- Qt.quit();
- }
-
- // Reset the state on 'C' operator or after
- // an error occurred
- if (op == "C" || display.isError) {
- display.clear()
- curVal = 0
- memory = 0
- lastOp = ""
- digits = ""
- }
-}
-
diff --git a/examples/quick/demos/calqlatr/content/images/paper-edge-left.png b/examples/quick/demos/calqlatr/content/images/paper-edge-left.png
deleted file mode 100644
index ca29a3ae10..0000000000
--- a/examples/quick/demos/calqlatr/content/images/paper-edge-left.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/calqlatr/content/images/paper-edge-right.png b/examples/quick/demos/calqlatr/content/images/paper-edge-right.png
deleted file mode 100644
index 7c2da7b930..0000000000
--- a/examples/quick/demos/calqlatr/content/images/paper-edge-right.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/calqlatr/content/images/paper-grip.png b/examples/quick/demos/calqlatr/content/images/paper-grip.png
deleted file mode 100644
index 953c408bca..0000000000
--- a/examples/quick/demos/calqlatr/content/images/paper-grip.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png b/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png
deleted file mode 100644
index af67f63dd1..0000000000
--- a/examples/quick/demos/calqlatr/doc/images/qtquick-demo-calqlatr.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
deleted file mode 100644
index 02503fe3b9..0000000000
--- a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
+++ /dev/null
@@ -1,195 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Calqlatr
- \ingroup qtquickdemos
- \example demos/calqlatr
- \brief A QML app designed for portrait devices that uses custom components,
- animated with AnimationController, and JavaScript for the application logic.
- \image qtquick-demo-calqlatr.png
-
- \e{Calqlatr} demonstrates various QML and \l{Qt Quick} features, such as
- displaying custom components and using animation to move the components
- around in the application view. The application logic is implemented in
- JavaScript and the appearance is implemented in QML.
-
- \include examples-run.qdocinc
-
- \section1 Displaying Custom Components
-
- In the Calqlatr application, we use the following custom types that are
- each defined in a separate .qml file:
-
- \list
- \li Button.qml
- \li Display.qml
- \li NumberPad.qml
- \endlist
-
- To use the custom types, we add an import statement to the main QML file,
- calqlatr.qml that imports the folder called \c content where the types are
- located:
-
- \code
- import "content"
- \endcode
-
- We can then display custom components by adding the component types to
- any QML file. For example, we use the NumberPad type in calqlatr.qml to
- create the number pad of the calculator. We place the type inside an
- \l{Item} QML type, which is the base type for all visual items in Qt Quick:
-
- \quotefromfile demos/calqlatr/calqlatr.qml
- \skipto Item
- \printuntil }
- \printuntil }
-
- Further, we use the Button type in the \c NumberPad type to create the
- calculator buttons. Button.qml specifies the basic properties for a
- button that we can modify for each button instance in NumberPad.qml. For the
- digit and separator buttons, we additionally specify the text property using
- the property alias \c text that we define in Button.qml.
-
- For the operator buttons, we also specify another color (green) using the
- property alias \c color and set the operator property to \c true. We use
- the operator property in functions that perform the calculations.
-
- We place the buttons inside a \l{Grid} QML type to position them in a grid:
-
- \quotefromfile demos/calqlatr/content/NumberPad.qml
- \skipto Grid
- \printuntil /^\}/
-
- Some of the buttons also have a \c dimmable property set, meaning that they
- can be visually disabled (dimmed) whenever the calculator engine does not
- accept input from that button. As an example, the button for square root
- operator is dimmed for negative values.
-
- \section1 Animating Components
-
- We use the Display type to display calculations. In Display.qml, we use
- images to make the display component look like a slip of paper that contains
- a grip. Users can drag the grip to move the display from left to right.
-
- When users release the grip, the AnimationController QML type that we define
- in the calqlatr.qml file finishes running the controlled animation in either
- a forwards or a backwards direction. To run the animation, we call either
- completeToEnd() or completeToBeginning(), depending on the direction. We do
- this in the MouseArea's \c onReleased signal handler, where \c controller
- is the id of our AnimationController:
-
- \quotefromfile demos/calqlatr/calqlatr.qml
- \skipto MouseArea
- \printuntil {
- \dots 12
- \skipto onReleased
- \printuntil }
- \printuntil }
-
- Unlike other QML animation types, AnimationController is not driven by
- internal timers but by explicitly setting its progress property to a
- value between \c 0.0 and \c 1.0.
-
- Inside the AnimationController, we run two NumberAnimation instances in
- parallel to move the number pad and the display components simultaneously to
- the opposite sides of the view. In addition, we run a SequentialAnimation
- instance to scale the number pad during the transition, giving the animation
- some depth.
-
- \quotefromfile demos/calqlatr/calqlatr.qml
- \skipto AnimationController
- \printuntil 1; easing.type
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use the easing curve of the type \c Easing.InOutQuad to accelerate the
- motion until halfway and then decelerate it.
-
- In Button.qml, the text colors of the number pad buttons are also animated.
-
- \quotefromfile demos/calqlatr/content/Button.qml
- \skipto Text
- \printuntil id:
- \dots 8
- \skipto color:
- \printuntil ]
- \printuntil }
-
- We use \l {QtQml::Qt::darker()}{Qt.darker()} to darken the color when the
- button is dimmed, and \l {QtQml::Qt::lighter()}{Qt.lighter()} to \e {light up}
- the button when pressed. The latter is done in a separate \l [QML] {State}
- {state} called \e "pressed", which activates when the \c pressed
- property of the button's MouseArea is set.
-
- The color changes are animated by defining a \l Behavior on the \c color
- property.
-
- In order to dynamically change the \c dimmed property of all the buttons
- of the \c NumberPad, we connect its \c buttonPressed signal to the
- \c Button's \c updateDimmed() function in Button.qml:
-
- \quotefromfile demos/calqlatr/content/Button.qml
- \skipto function updateDimmed() {
- \printuntil buttonPressed.connect
- \printuntil }
-
- This way, when a button is pressed, all buttons on the \c NumPad
- receive a \c buttonPressed signal and are activated or deactivated
- according to the state of the calculator engine.
-
- \section1 Performing Calculations
-
- The calculator.js file defines our calculator engine. It contains variables
- to store the calculator state, and functions that are called when the
- user presses the digit and operator buttons. To use the engine, we
- import calculator.js in the calqlatr.qml file as \c CalcEngine:
-
- \code
- import "content/calculator.js" as CalcEngine
- \endcode
-
- Importing the engine creates a new instance of it. Therefore, we only do it
- in the main QML file, \c calqlatr.qml. The root item defined in this file
- contains helper functions that allow other types to access the calculator
- engine:
-
- \quotefromfile demos/calqlatr/calqlatr.qml
- \skipto operatorPressed
- \printuntil CalcEngine.disabled
- \printuntil }
-
- When users press a digit, the text from the digit appears on the
- display. When they press an operator, the appropriate calculation is
- performed, and the result can be displayed using the equals (=) operator.
- The clear (C) operator resets the calculator engine.
-
- \section1 List of Files
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/calqlatr/main.cpp b/examples/quick/demos/calqlatr/main.cpp
deleted file mode 100644
index bc6e591e98..0000000000
--- a/examples/quick/demos/calqlatr/main.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/calqlatr/calqlatr)
diff --git a/examples/quick/demos/clocks/clocks.pro b/examples/quick/demos/clocks/clocks.pro
deleted file mode 100644
index 21d3f7f971..0000000000
--- a/examples/quick/demos/clocks/clocks.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick
-
-SOURCES += main.cpp
-RESOURCES += clocks.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/clocks
-INSTALLS += target
-
-OTHER_FILES += \
- clocks.qml \
- content/Clock.qml \
- content/*.png
diff --git a/examples/quick/demos/clocks/clocks.qml b/examples/quick/demos/clocks/clocks.qml
deleted file mode 100644
index 5224e29a38..0000000000
--- a/examples/quick/demos/clocks/clocks.qml
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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" as 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: Content.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/quick/demos/clocks/clocks.qmlproject b/examples/quick/demos/clocks/clocks.qmlproject
deleted file mode 100644
index b15654600e..0000000000
--- a/examples/quick/demos/clocks/clocks.qmlproject
+++ /dev/null
@@ -1,8 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "clocks.qml"
- QmlFiles { directory: "." }
- JavaScriptFiles { directory: "." }
- ImageFiles { directory: "." }
-}
diff --git a/examples/quick/demos/clocks/clocks.qrc b/examples/quick/demos/clocks/clocks.qrc
deleted file mode 100644
index eaff4729ae..0000000000
--- a/examples/quick/demos/clocks/clocks.qrc
+++ /dev/null
@@ -1,15 +0,0 @@
-<RCC>
- <qresource prefix="/demos/clocks">
- <file>clocks.qml</file>
- <file>content/arrow.png</file>
- <file>content/background.png</file>
- <file>content/center.png</file>
- <file>content/clock-night.png</file>
- <file>content/clock.png</file>
- <file>content/Clock.qml</file>
- <file>content/hour.png</file>
- <file>content/minute.png</file>
- <file>content/quit.png</file>
- <file>content/second.png</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/clocks/content/Clock.qml b/examples/quick/demos/clocks/content/Clock.qml
deleted file mode 100644
index 542333d13d..0000000000
--- a/examples/quick/demos/clocks/content/Clock.qml
+++ /dev/null
@@ -1,150 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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"
- 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"
- 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"
- 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/quick/demos/clocks/content/arrow.png b/examples/quick/demos/clocks/content/arrow.png
deleted file mode 100644
index e437312217..0000000000
--- a/examples/quick/demos/clocks/content/arrow.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/background.png b/examples/quick/demos/clocks/content/background.png
deleted file mode 100644
index a885950862..0000000000
--- a/examples/quick/demos/clocks/content/background.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/center.png b/examples/quick/demos/clocks/content/center.png
deleted file mode 100644
index 7fbd802a44..0000000000
--- a/examples/quick/demos/clocks/content/center.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/clock-night.png b/examples/quick/demos/clocks/content/clock-night.png
deleted file mode 100644
index cc7151a397..0000000000
--- a/examples/quick/demos/clocks/content/clock-night.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/clock.png b/examples/quick/demos/clocks/content/clock.png
deleted file mode 100644
index 462edacc0e..0000000000
--- a/examples/quick/demos/clocks/content/clock.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/hour.png b/examples/quick/demos/clocks/content/hour.png
deleted file mode 100644
index 9f33fc5d48..0000000000
--- a/examples/quick/demos/clocks/content/hour.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/minute.png b/examples/quick/demos/clocks/content/minute.png
deleted file mode 100644
index e2f216c897..0000000000
--- a/examples/quick/demos/clocks/content/minute.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/quit.png b/examples/quick/demos/clocks/content/quit.png
deleted file mode 100644
index b822057d4e..0000000000
--- a/examples/quick/demos/clocks/content/quit.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/content/second.png b/examples/quick/demos/clocks/content/second.png
deleted file mode 100644
index d95d99e83d..0000000000
--- a/examples/quick/demos/clocks/content/second.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png b/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png
deleted file mode 100644
index 94b641d891..0000000000
--- a/examples/quick/demos/clocks/doc/images/qtquick-demo-clocks-small.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/clocks/doc/src/clocks.qdoc b/examples/quick/demos/clocks/doc/src/clocks.qdoc
deleted file mode 100644
index a4bf1a1f82..0000000000
--- a/examples/quick/demos/clocks/doc/src/clocks.qdoc
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Clocks
- \ingroup qtquickdemos
- \example demos/clocks
- \brief A QML clock application that demonstrates using a ListView type to
- display data generated by a ListModel and a SpringAnimation type to animate
- images.
- \image qtquick-demo-clocks-small.png
-
- \e Clocks demonstrates using a ListView type to display data generated by a
- ListModel. The delegate used by the model is specified as a custom QML type
- that is specified in the Clock.qml file.
-
- JavaScript methods are used to fetch the current time in several cities in
- different time zones and QML types are used to display the time on a clock
- face with animated clock hands.
-
- \include examples-run.qdocinc
-
- \section1 Displaying Data Generated by List Models
-
- In the clocks.qml file, we use a \l Rectangle type to create the application
- main window:
-
- \quotefromfile demos/clocks/clocks.qml
- \skipto Rectangle
- \printuntil color
-
- We use a ListView type to display a list of the items provided by a
- ListModel type:
-
- \printuntil Los Angeles
- \printuntil }
- \printuntil }
-
- List elements are defined like other QML types except that they contain a
- collection of \e role definitions instead of properties. Roles both define
- how the data is accessed and include the data itself.
-
- For each list element, we use the \c cityName role to specify the name of a
- city and the \c timeShift role to specify a time zone as a positive or
- negative offset from UTC (coordinated universal time).
-
- The Clock custom type is used as the ListView's \c delegate, defining the
- visual appearance of list items. To use the Clock type, we add an import
- statement that imports the folder called \c content where the type is
- located:
-
- \quotefromfile demos/clocks/clocks.qml
- \skipto content
- \printuntil "
-
- We use an \l Image type to display arrows that indicate whether users can
- flick the view to see more clocks on the left or right:
-
- \quotefromfile demos/clocks/clocks.qml
- \skipto Image
- \printuntil /^\}/
-
- We use the \c opacity property to hide the arrows when the list view is
- located at the beginning or end of the x axis.
-
- In Clock.qml, we define a \c timeChanged() function in which we use
- methods from the JavaScript \c Date object to fetch the current time in
- UTC and to adjust it to the correct time zone:
-
- \quotefromfile demos/clocks/content/Clock.qml
- \skipto timeChanged
- \printuntil }
-
- We use a \l Timer type to update the time at intervals of 100 milliseconds:
-
- \printuntil }
-
- We use \l Image types within an \l Item type to display the time on an
- analog clock face. Different images are used for daytime and nighttime
- hours:
-
- \printuntil clock-night.png
-
- A \l Rotation transform applied to \l Image types provides a way to rotate
- the clock hands. The \c origin property holds the point that stays fixed
- relative to the parent as the rest of the item rotates. The \c angle
- property determines the angle to rotate the hands in degrees clockwise.
-
- \printuntil center.png
- \printuntil }
-
- We use a \l Behavior type on the \c angle property to apply a
- SpringAnimation when the time changes. The \c spring and \c damping
- properties enable the spring-like motion of the clock hands, and a
- \c modulus of \c 360 makes the animation target values wrap around at a
- full circle.
-
- We use a \l Text type to display the city name below the clock:
-
- \printuntil }
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/clocks/main.cpp b/examples/quick/demos/clocks/main.cpp
deleted file mode 100644
index 5d5b0ca64d..0000000000
--- a/examples/quick/demos/clocks/main.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/clocks/clocks)
diff --git a/examples/quick/demos/demos.pro b/examples/quick/demos/demos.pro
deleted file mode 100644
index 0644b81a22..0000000000
--- a/examples/quick/demos/demos.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = samegame \
- calqlatr \
- clocks \
- tweetsearch \
- maroon \
- photosurface \
- stocqt
-
-qtHaveModule(xmlpatterns): SUBDIRS += rssnews photoviewer
-
diff --git a/examples/quick/demos/maroon/content/BuildButton.qml b/examples/quick/demos/maroon/content/BuildButton.qml
deleted file mode 100644
index 09d37746f1..0000000000
--- a/examples/quick/demos/maroon/content/BuildButton.qml
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "logic.js" as Logic
-
-Item {
- id: container
- width: 64
- height: 64
- property alias source: img.source
- property int index
- property int row: 0
- property int col: 0
- property int towerType
- property bool canBuild: true
- property Item gameCanvas: parent.parent.parent
- signal clicked()
-
- Image {
- id: img
- opacity: (canBuild && gameCanvas.coins >= Logic.towerData[towerType-1].cost) ? 1.0 : 0.4
- }
- Text {
- anchors.right: parent.right
- font.pointSize: 14
- font.bold: true
- color: "#ffffff"
- text: Logic.towerData[towerType - 1].cost
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- Logic.buildTower(towerType, col, row)
- container.clicked()
- }
- }
- Image {
- visible: col == index && row != 0
- source: "gfx/dialog-pointer.png"
- anchors.top: parent.bottom
- anchors.topMargin: 4
- anchors.horizontalCenter: parent.horizontalCenter
- }
- Image {
- visible: col == index && row == 0
- source: "gfx/dialog-pointer.png"
- rotation: 180
- anchors.bottom: parent.top
- anchors.bottomMargin: 6
- anchors.horizontalCenter: parent.horizontalCenter
- }
-}
diff --git a/examples/quick/demos/maroon/content/GameCanvas.qml b/examples/quick/demos/maroon/content/GameCanvas.qml
deleted file mode 100644
index 0c6772dc98..0000000000
--- a/examples/quick/demos/maroon/content/GameCanvas.qml
+++ /dev/null
@@ -1,250 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "logic.js" as Logic
-import "towers" as Towers
-
-Item {
- id: grid
-
- property int squareSize: 64
- property int rows: 6
- property int cols: 4
- property Item canvas: grid
- property int score: 0
- property int coins: 100
- property int lives: 3
- property int waveNumber: 0
- property int waveProgress: 0
- property var towers
- property var mobs
- property bool gameRunning: false
- property bool gameOver: false
- property bool errored: false
- property string errorString: ""
-
- width: cols * squareSize
- height: rows * squareSize
-
- function freshState() {
- lives = 3
- coins = 100
- score = 0
- waveNumber = 0
- waveProgress = 0
- gameOver = false
- gameRunning = false
- towerMenu.shown = false
- helpButton.comeBack();
- }
-
- Text {
- id: errorText // Mostly for debug purposes
- text: errorString
- visible: errored
- color: "red"
- font.pixelSize: 18
- wrapMode: Text.WordWrap
- width: parent.width / 1.2
- height: parent.height / 1.2
- anchors.centerIn: parent
- z: 1000
- }
-
- Timer {
- interval: 16
- running: true
- repeat: true
- onTriggered: Logic.tick()
- }
-
- MouseArea {
- id: ma
- anchors.fill: parent
- onClicked: {
- if (towerMenu.visible)
- towerMenu.finish()
- else
- towerMenu.open(mouse.x, mouse.y)
- }
- }
-
- Image {
- id: towerMenu
- visible: false
- z: 1500
- scale: 0.9
- opacity: 0.7
- property int dragDistance: 16
- property int targetRow: 0
- property int targetCol: 0
- property bool shown: false
- property bool towerExists: false
-
- function finish() {
- shown = false
- }
-
- function open(xp,yp) {
- if (!grid.gameRunning)
- return
- targetRow = Logic.row(yp)
- targetCol = Logic.col(xp)
- if (targetRow == 0)
- towerMenu.y = (targetRow + 1) * grid.squareSize
- else
- towerMenu.y = (targetRow - 1) * grid.squareSize
- towerExists = (grid.towers[Logic.towerIdx(targetCol, targetRow)] != null)
- shown = true
- helpButton.goAway();
- }
-
- states: State {
- name: "shown"; when: towerMenu.shown && !grid.gameOver
- PropertyChanges { target: towerMenu; visible: true; scale: 1; opacity: 1 }
- }
-
- transitions: Transition {
- PropertyAction { property: "visible" }
- NumberAnimation { properties: "opacity,scale"; duration: 500; easing.type: Easing.OutElastic }
- }
-
- x: -32
- source: "gfx/dialog.png"
- Row {
- id: buttonRow
- height: 100
- anchors.centerIn: parent
- spacing: 8
- BuildButton {
- row: towerMenu.targetRow; col: towerMenu.targetCol
- anchors.verticalCenter: parent.verticalCenter
- towerType: 1; index: 0
- canBuild: !towerMenu.towerExists
- source: "gfx/dialog-melee.png"
- onClicked: towerMenu.finish()
- }
- BuildButton {
- row: towerMenu.targetRow; col: towerMenu.targetCol
- anchors.verticalCenter: parent.verticalCenter
- towerType: 2; index: 1
- canBuild: !towerMenu.towerExists
- source: "gfx/dialog-shooter.png"
- onClicked: towerMenu.finish()
- }
- BuildButton {
- row: towerMenu.targetRow; col: towerMenu.targetCol
- anchors.verticalCenter: parent.verticalCenter
- towerType: 3; index: 2
- canBuild: !towerMenu.towerExists
- source: "gfx/dialog-bomb.png"
- onClicked: towerMenu.finish()
- }
- BuildButton {
- row: towerMenu.targetRow; col: towerMenu.targetCol
- anchors.verticalCenter: parent.verticalCenter
- towerType: 4; index: 3
- canBuild: !towerMenu.towerExists
- source: "gfx/dialog-factory.png"
- onClicked: towerMenu.finish()
- }
- }
- }
-
-
- Keys.onPressed: { // Cheat Codes while Testing
- if (event.key == Qt.Key_Up && (event.modifiers & Qt.ShiftModifier))
- grid.coins += 10;
- if (event.key == Qt.Key_Left && (event.modifiers & Qt.ShiftModifier))
- grid.lives += 1;
- if (event.key == Qt.Key_Down && (event.modifiers & Qt.ShiftModifier))
- Logic.gameState.waveProgress += 1000;
- if (event.key == Qt.Key_Right && (event.modifiers & Qt.ShiftModifier))
- Logic.endGame();
- }
-
- Image {
- id: helpButton
- z: 1010
- source: "gfx/button-help.png"
- function goAway() {
- helpMA.enabled = false;
- helpButton.opacity = 0;
- }
- function comeBack() {
- helpMA.enabled = true;
- helpButton.opacity = 1;
- }
- Behavior on opacity { NumberAnimation {} }
- MouseArea {
- id: helpMA
- anchors.fill: parent
- onClicked: {helpImage.visible = true; helpButton.visible = false;}
- }
-
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 0
- }
-
- Image {
- id: helpImage
- z: 1010
- source: "gfx/help.png"
- anchors.fill: parent
- visible: false
- MouseArea {
- anchors.fill: parent
- onClicked: helpImage.visible = false;
- }
- }
-
-}
diff --git a/examples/quick/demos/maroon/content/GameOverScreen.qml b/examples/quick/demos/maroon/content/GameOverScreen.qml
deleted file mode 100644
index 6de3b13bad..0000000000
--- a/examples/quick/demos/maroon/content/GameOverScreen.qml
+++ /dev/null
@@ -1,125 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-import "logic.js" as Logic
-
-Item {
- id: gameOverScreen
- width: 320
- height: 400
- property GameCanvas gameCanvas
-
- Image {
- id: img
- source: "gfx/text-gameover.png"
- anchors.centerIn: parent
- }
-
- ParticleSystem {
- anchors.fill: parent
- ImageParticle {
- id: cloud
- source: "gfx/cloud.png"
- alphaVariation: 0.25
- opacity: 0.25
- }
-
- Wander {
- xVariance: 100;
- pace: 1;
- }
-
- Emitter {
- id: cloudLeft
- width: 160
- height: 160
- anchors.right: parent.left
- emitRate: 0.5
- lifeSpan: 12000
- velocity: PointDirection{ x: 64; xVariation: 2; yVariation: 2 }
- size: 160
- }
-
- Emitter {
- id: cloudRight
- width: 160
- height: 160
- anchors.left: parent.right
- emitRate: 0.5
- lifeSpan: 12000
- velocity: PointDirection{ x: -64; xVariation: 2; yVariation: 2 }
- size: 160
- }
- }
-
-
- Text {
- visible: gameCanvas != undefined
- text: "You saved " + gameCanvas.score + " fishes!"
- anchors.top: img.bottom
- anchors.topMargin: 12
- anchors.horizontalCenter: parent.horizontalCenter
- font.bold: true
- color: "#000000"
- opacity: 0.5
- }
-
- Image {
- source: "gfx/button-play.png"
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 0
- MouseArea {
- anchors.fill: parent
- onClicked: gameCanvas.gameOver = false//This will actually trigger the state change in main.qml
- }
- }
-}
diff --git a/examples/quick/demos/maroon/content/InfoBar.qml b/examples/quick/demos/maroon/content/InfoBar.qml
deleted file mode 100644
index 8176b1a37e..0000000000
--- a/examples/quick/demos/maroon/content/InfoBar.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 {
- height: childrenRect.height
-
- // Display the number of lives
- Row {
- anchors.left: parent.left
- anchors.leftMargin: 10
- spacing: 5
- Repeater {
- id: rep
- model: Math.min(10, canvas.lives)
- delegate: Image { source: "gfx/lifes.png" }
- }
- }
-
- // Display the number of fishes saved
- Row {
- anchors.right: points.left
- anchors.rightMargin: 20
- spacing: 5
- Image { source: "gfx/scores.png" }
- Text {
- text: canvas.score
- font.bold: true
- }
- }
-
- // Display the number of coins
- Row {
- id: points
- anchors.right: parent.right
- anchors.rightMargin: 10
- spacing: 5
- Image { source: "gfx/points.png" }
- Text {
- id: pointsLabel
- text: canvas.coins
- font.bold: true
- }
- }
-}
-
diff --git a/examples/quick/demos/maroon/content/NewGameScreen.qml b/examples/quick/demos/maroon/content/NewGameScreen.qml
deleted file mode 100644
index d87e6b36f7..0000000000
--- a/examples/quick/demos/maroon/content/NewGameScreen.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-// This is the first screen.
-// It shows the logo and emit a startButtonClicked signal
-// when the user press the "PLAY" button.
-
-Item {
- id: newGameScreen
- width: 320
- height: 480
-
- signal startButtonClicked
-
- Image {
- source: "gfx/logo.png"
- anchors.top: parent.top
- anchors.topMargin: 60
- }
-
- Image {
- source: "gfx/logo-fish.png"
- anchors.top: parent.top
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: x + 148; to: x + 25; duration: 2000; easing.type: Easing.InOutQuad }
- NumberAnimation { from: x + 25; to: x + 148; duration: 1600; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on anchors.topMargin {
- loops: Animation.Infinite
- NumberAnimation { from: 100; to: 60; duration: 1600; easing.type: Easing.InOutQuad }
- NumberAnimation { from: 60; to: 100; duration: 2000; easing.type: Easing.InOutQuad }
- }
- }
-
- Image {
- source: "gfx/logo-bubble.png"
- anchors.top: parent.top
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: x + 140; to: x + 40; duration: 2000; easing.type: Easing.InOutQuad }
- NumberAnimation { from: x + 40; to: x + 140; duration: 1600; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on anchors.topMargin {
- loops: Animation.Infinite
- NumberAnimation { from: 100; to: 60; duration: 1600; easing.type: Easing.InOutQuad }
- NumberAnimation { from: 60; to: 100; duration: 2000; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on width {
- loops: Animation.Infinite
- NumberAnimation { from: 140; to: 160; duration: 1000; easing.type: Easing.InOutQuad }
- NumberAnimation { from: 160; to: 140; duration: 800; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on height {
- loops: Animation.Infinite
- NumberAnimation { from: 150; to: 140; duration: 800; easing.type: Easing.InOutQuad }
- NumberAnimation { from: 140; to: 150; duration: 1000; easing.type: Easing.InOutQuad }
- }
- }
-
- Image {
- source: "gfx/button-play.png"
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 60
- MouseArea {
- anchors.fill: parent
- onClicked: newGameScreen.startButtonClicked()
- }
- }
-}
diff --git a/examples/quick/demos/maroon/content/SoundEffect.qml b/examples/quick/demos/maroon/content/SoundEffect.qml
deleted file mode 100644
index 35a68eb5e0..0000000000
--- a/examples/quick/demos/maroon/content/SoundEffect.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-//Proxies a SoundEffect if QtMultimedia is installed
-Item {
- id: container
- property QtObject effect: Qt.createQmlObject("import QtMultimedia 5.0; SoundEffect{ source: '" + container.source + "'; muted: Qt.application.state != Qt.ApplicationActive }", container);
- property url source: ""
- onSourceChanged: if (effect != null) effect.source = source;
- function play() {
- if (effect != null)
- effect.play();
- }
-}
diff --git a/examples/quick/demos/maroon/content/audio/bomb-action.wav b/examples/quick/demos/maroon/content/audio/bomb-action.wav
deleted file mode 100644
index b334dc1e5b..0000000000
--- a/examples/quick/demos/maroon/content/audio/bomb-action.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/catch-action.wav b/examples/quick/demos/maroon/content/audio/catch-action.wav
deleted file mode 100644
index 3e22124abf..0000000000
--- a/examples/quick/demos/maroon/content/audio/catch-action.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/catch.wav b/examples/quick/demos/maroon/content/audio/catch.wav
deleted file mode 100644
index d3eade87f8..0000000000
--- a/examples/quick/demos/maroon/content/audio/catch.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/currency.wav b/examples/quick/demos/maroon/content/audio/currency.wav
deleted file mode 100644
index 0d9ef2c200..0000000000
--- a/examples/quick/demos/maroon/content/audio/currency.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/factory-action.wav b/examples/quick/demos/maroon/content/audio/factory-action.wav
deleted file mode 100644
index a2ace6c221..0000000000
--- a/examples/quick/demos/maroon/content/audio/factory-action.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/melee-action.wav b/examples/quick/demos/maroon/content/audio/melee-action.wav
deleted file mode 100644
index d325af4700..0000000000
--- a/examples/quick/demos/maroon/content/audio/melee-action.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/projectile-action.wav b/examples/quick/demos/maroon/content/audio/projectile-action.wav
deleted file mode 100644
index 4e2284fceb..0000000000
--- a/examples/quick/demos/maroon/content/audio/projectile-action.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/audio/shooter-action.wav b/examples/quick/demos/maroon/content/audio/shooter-action.wav
deleted file mode 100644
index 3e12b9419a..0000000000
--- a/examples/quick/demos/maroon/content/audio/shooter-action.wav
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/background.png b/examples/quick/demos/maroon/content/gfx/background.png
deleted file mode 100644
index d548b9314e..0000000000
--- a/examples/quick/demos/maroon/content/gfx/background.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/bomb-action.png b/examples/quick/demos/maroon/content/gfx/bomb-action.png
deleted file mode 100644
index 42da5d789f..0000000000
--- a/examples/quick/demos/maroon/content/gfx/bomb-action.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/bomb-idle.png b/examples/quick/demos/maroon/content/gfx/bomb-idle.png
deleted file mode 100644
index 3bd62e261d..0000000000
--- a/examples/quick/demos/maroon/content/gfx/bomb-idle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/bomb.png b/examples/quick/demos/maroon/content/gfx/bomb.png
deleted file mode 100644
index 380da7d1a5..0000000000
--- a/examples/quick/demos/maroon/content/gfx/bomb.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/button-help.png b/examples/quick/demos/maroon/content/gfx/button-help.png
deleted file mode 100644
index aecebc1275..0000000000
--- a/examples/quick/demos/maroon/content/gfx/button-help.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/button-play.png b/examples/quick/demos/maroon/content/gfx/button-play.png
deleted file mode 100644
index 6cdad6c845..0000000000
--- a/examples/quick/demos/maroon/content/gfx/button-play.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/catch-action.png b/examples/quick/demos/maroon/content/gfx/catch-action.png
deleted file mode 100644
index 78ca9fe1cc..0000000000
--- a/examples/quick/demos/maroon/content/gfx/catch-action.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/catch.png b/examples/quick/demos/maroon/content/gfx/catch.png
deleted file mode 100644
index b7620fe3de..0000000000
--- a/examples/quick/demos/maroon/content/gfx/catch.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/cloud.png b/examples/quick/demos/maroon/content/gfx/cloud.png
deleted file mode 100644
index d7c35f8555..0000000000
--- a/examples/quick/demos/maroon/content/gfx/cloud.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/currency.png b/examples/quick/demos/maroon/content/gfx/currency.png
deleted file mode 100644
index 1571341f6c..0000000000
--- a/examples/quick/demos/maroon/content/gfx/currency.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/dialog-bomb.png b/examples/quick/demos/maroon/content/gfx/dialog-bomb.png
deleted file mode 100644
index 708d916ad7..0000000000
--- a/examples/quick/demos/maroon/content/gfx/dialog-bomb.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/dialog-factory.png b/examples/quick/demos/maroon/content/gfx/dialog-factory.png
deleted file mode 100644
index d2e2a48e31..0000000000
--- a/examples/quick/demos/maroon/content/gfx/dialog-factory.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/dialog-melee.png b/examples/quick/demos/maroon/content/gfx/dialog-melee.png
deleted file mode 100644
index 069d18d477..0000000000
--- a/examples/quick/demos/maroon/content/gfx/dialog-melee.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/dialog-pointer.png b/examples/quick/demos/maroon/content/gfx/dialog-pointer.png
deleted file mode 100644
index 9b51a090f9..0000000000
--- a/examples/quick/demos/maroon/content/gfx/dialog-pointer.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/dialog-shooter.png b/examples/quick/demos/maroon/content/gfx/dialog-shooter.png
deleted file mode 100644
index af980caabd..0000000000
--- a/examples/quick/demos/maroon/content/gfx/dialog-shooter.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/dialog.png b/examples/quick/demos/maroon/content/gfx/dialog.png
deleted file mode 100644
index d528ba78d1..0000000000
--- a/examples/quick/demos/maroon/content/gfx/dialog.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/factory-action.png b/examples/quick/demos/maroon/content/gfx/factory-action.png
deleted file mode 100644
index 8981678267..0000000000
--- a/examples/quick/demos/maroon/content/gfx/factory-action.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/factory-idle.png b/examples/quick/demos/maroon/content/gfx/factory-idle.png
deleted file mode 100644
index a145582c8f..0000000000
--- a/examples/quick/demos/maroon/content/gfx/factory-idle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/factory.png b/examples/quick/demos/maroon/content/gfx/factory.png
deleted file mode 100644
index bfb9f3fb79..0000000000
--- a/examples/quick/demos/maroon/content/gfx/factory.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/grid.png b/examples/quick/demos/maroon/content/gfx/grid.png
deleted file mode 100644
index b59555247a..0000000000
--- a/examples/quick/demos/maroon/content/gfx/grid.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/help.png b/examples/quick/demos/maroon/content/gfx/help.png
deleted file mode 100644
index 4654e4c69b..0000000000
--- a/examples/quick/demos/maroon/content/gfx/help.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/lifes.png b/examples/quick/demos/maroon/content/gfx/lifes.png
deleted file mode 100644
index 135310b38c..0000000000
--- a/examples/quick/demos/maroon/content/gfx/lifes.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/logo-bubble.png b/examples/quick/demos/maroon/content/gfx/logo-bubble.png
deleted file mode 100644
index 136151caff..0000000000
--- a/examples/quick/demos/maroon/content/gfx/logo-bubble.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/logo-fish.png b/examples/quick/demos/maroon/content/gfx/logo-fish.png
deleted file mode 100644
index c41833a0c9..0000000000
--- a/examples/quick/demos/maroon/content/gfx/logo-fish.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/logo.png b/examples/quick/demos/maroon/content/gfx/logo.png
deleted file mode 100644
index 787ac99ce8..0000000000
--- a/examples/quick/demos/maroon/content/gfx/logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/melee-action.png b/examples/quick/demos/maroon/content/gfx/melee-action.png
deleted file mode 100644
index c53873bfcc..0000000000
--- a/examples/quick/demos/maroon/content/gfx/melee-action.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/melee-idle.png b/examples/quick/demos/maroon/content/gfx/melee-idle.png
deleted file mode 100644
index 621d9dff54..0000000000
--- a/examples/quick/demos/maroon/content/gfx/melee-idle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/melee.png b/examples/quick/demos/maroon/content/gfx/melee.png
deleted file mode 100644
index ab240151f3..0000000000
--- a/examples/quick/demos/maroon/content/gfx/melee.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/mob-idle.png b/examples/quick/demos/maroon/content/gfx/mob-idle.png
deleted file mode 100644
index dedacc7866..0000000000
--- a/examples/quick/demos/maroon/content/gfx/mob-idle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/mob.png b/examples/quick/demos/maroon/content/gfx/mob.png
deleted file mode 100644
index 7569c3525a..0000000000
--- a/examples/quick/demos/maroon/content/gfx/mob.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/points.png b/examples/quick/demos/maroon/content/gfx/points.png
deleted file mode 100644
index 1d2386dbe7..0000000000
--- a/examples/quick/demos/maroon/content/gfx/points.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/projectile-action.png b/examples/quick/demos/maroon/content/gfx/projectile-action.png
deleted file mode 100644
index aa2e650aeb..0000000000
--- a/examples/quick/demos/maroon/content/gfx/projectile-action.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/projectile.png b/examples/quick/demos/maroon/content/gfx/projectile.png
deleted file mode 100644
index c25a0c3890..0000000000
--- a/examples/quick/demos/maroon/content/gfx/projectile.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/scores.png b/examples/quick/demos/maroon/content/gfx/scores.png
deleted file mode 100644
index af757fe64a..0000000000
--- a/examples/quick/demos/maroon/content/gfx/scores.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/shooter-action.png b/examples/quick/demos/maroon/content/gfx/shooter-action.png
deleted file mode 100644
index 08e7e300ca..0000000000
--- a/examples/quick/demos/maroon/content/gfx/shooter-action.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/shooter-idle.png b/examples/quick/demos/maroon/content/gfx/shooter-idle.png
deleted file mode 100644
index 663098d3b0..0000000000
--- a/examples/quick/demos/maroon/content/gfx/shooter-idle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/shooter.png b/examples/quick/demos/maroon/content/gfx/shooter.png
deleted file mode 100644
index d44401e055..0000000000
--- a/examples/quick/demos/maroon/content/gfx/shooter.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/sunlight.png b/examples/quick/demos/maroon/content/gfx/sunlight.png
deleted file mode 100644
index d1c7042117..0000000000
--- a/examples/quick/demos/maroon/content/gfx/sunlight.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/text-1.png b/examples/quick/demos/maroon/content/gfx/text-1.png
deleted file mode 100644
index 3ea399cc90..0000000000
--- a/examples/quick/demos/maroon/content/gfx/text-1.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/text-2.png b/examples/quick/demos/maroon/content/gfx/text-2.png
deleted file mode 100644
index 934a481f3b..0000000000
--- a/examples/quick/demos/maroon/content/gfx/text-2.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/text-3.png b/examples/quick/demos/maroon/content/gfx/text-3.png
deleted file mode 100644
index 47523f55b8..0000000000
--- a/examples/quick/demos/maroon/content/gfx/text-3.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/text-blank.png b/examples/quick/demos/maroon/content/gfx/text-blank.png
deleted file mode 100644
index 4a687b24dc..0000000000
--- a/examples/quick/demos/maroon/content/gfx/text-blank.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/text-gameover.png b/examples/quick/demos/maroon/content/gfx/text-gameover.png
deleted file mode 100644
index 4f53ef0b29..0000000000
--- a/examples/quick/demos/maroon/content/gfx/text-gameover.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/text-go.png b/examples/quick/demos/maroon/content/gfx/text-go.png
deleted file mode 100644
index bfc26f71fc..0000000000
--- a/examples/quick/demos/maroon/content/gfx/text-go.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/gfx/wave.png b/examples/quick/demos/maroon/content/gfx/wave.png
deleted file mode 100644
index f97426c4e7..0000000000
--- a/examples/quick/demos/maroon/content/gfx/wave.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/content/logic.js b/examples/quick/demos/maroon/content/logic.js
deleted file mode 100644
index 3830b5ad63..0000000000
--- a/examples/quick/demos/maroon/content/logic.js
+++ /dev/null
@@ -1,274 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-.pragma library // Shared game state
-.import QtQuick 2.0 as QQ
-
-// Game Stuff
-var gameState // Local reference
-function getGameState() { return gameState; }
-
-var towerData = [ // Name and cost, stats are in the delegate per instance
- { "name": "Melee", "cost": 20 },
- { "name": "Ranged", "cost": 50 },
- { "name": "Bomb", "cost": 75 },
- { "name": "Factory", "cost": 25 }
-]
-
-var waveBaseData = [300, 290, 280, 270, 220, 180, 160, 80, 80, 80, 30, 30, 30, 30];
-var waveData = [];
-
-var towerComponents = new Array(towerData.length);
-var mobComponent = Qt.createComponent("mobs/MobBase.qml");
-
-function endGame()
-{
- gameState.gameRunning = false;
- gameState.gameOver = true;
- for (var i = 0; i < gameState.cols; i++) {
- for (var j = 0; j < gameState.rows; j++) {
- if (gameState.towers[towerIdx(i, j)]) {
- gameState.towers[towerIdx(i, j)].destroy();
- gameState.towers[towerIdx(i, j)] = null;
- }
- }
- for (var j in gameState.mobs[i])
- gameState.mobs[i][j].destroy();
- gameState.mobs[i].splice(0,gameState.mobs[i].length); //Leaves queue reusable
- }
-}
-
-function startGame(gameCanvas)
-{
- waveData = new Array();
- for (var i in waveBaseData)
- waveData[i] = waveBaseData[i];
- gameState.freshState();
- for (var i = 0; i < gameCanvas.cols; i++) {
- for (var j = 0; j < gameCanvas.rows; j++)
- gameState.towers[towerIdx(i, j)] = null;
- gameState.mobs[i] = new Array();
- }
- gameState.towers[towerIdx(0, 0)] = newTower(3, 0, 0);//Start with a starfish in the corner
- gameState.gameRunning = true;
- gameState.gameOver = false;
-}
-
-function newGameState(gameCanvas)
-{
- for (var i = 0; i < towerComponents.length; i++) {
- towerComponents[i] = Qt.createComponent("towers/" + towerData[i].name + ".qml");
- if (towerComponents[i].status == QQ.Component.Error) {
- gameCanvas.errored = true;
- gameCanvas.errorString += "Loading Tower " + towerData[i].name + "\n" + (towerComponents[i].errorString());
- console.log(towerComponents[i].errorString());
- }
- }
- gameState = gameCanvas;
- gameState.freshState();
- gameState.towers = new Array(gameCanvas.rows * gameCanvas.cols);
- gameState.mobs = new Array(gameCanvas.cols);
- return gameState;
-}
-
-function row(y)
-{
- return Math.floor(y / gameState.squareSize);
-}
-
-function col(x)
-{
- return Math.floor(x / gameState.squareSize);
-}
-
-function towerIdx(x, y)
-{
- return y + (x * gameState.rows);
-}
-
-function newMob(col)
-{
- var ret = mobComponent.createObject(gameState.canvas,
- { "col" : col,
- "speed" : (Math.min(2.0, 0.10 * (gameState.waveNumber + 1))),
- "y" : gameState.canvas.height });
- gameState.mobs[col].push(ret);
- return ret;
-}
-
-function newTower(type, row, col)
-{
- var ret = towerComponents[type].createObject(gameState.canvas);
- ret.row = row;
- ret.col = col;
- ret.fireCounter = ret.rof;
- ret.spawn();
- return ret;
-}
-
-function buildTower(type, x, y)
-{
- if (gameState.towers[towerIdx(x,y)] != null) {
- if (type <= 0) {
- gameState.towers[towerIdx(x,y)].sell();
- gameState.towers[towerIdx(x,y)] = null;
- }
- } else {
- if (gameState.coins < towerData[type - 1].cost)
- return;
- gameState.towers[towerIdx(x, y)] = newTower(type - 1, y, x);
- gameState.coins -= towerData[type - 1].cost;
- }
-}
-
-function killMob(col, mob)
-{
- if (!mob)
- return;
- var idx = gameState.mobs[col].indexOf(mob);
- if (idx == -1 || !mob.hp)
- return;
- mob.hp = 0;
- mob.die();
- gameState.mobs[col].splice(idx,1);
-}
-
-function killTower(row, col)
-{
- var tower = gameState.towers[towerIdx(col, row)];
- if (!tower)
- return;
- tower.hp = 0;
- tower.die();
- gameState.towers[towerIdx(col, row)] = null;
-}
-
-function tick()
-{
- if (!gameState.gameRunning)
- return;
-
- // Spawn
- gameState.waveProgress += 1;
- var i = gameState.waveProgress;
- var j = 0;
- while (i > 0 && j < waveData.length)
- i -= waveData[j++];
- if ( i == 0 ) // Spawn a mob
- newMob(Math.floor(Math.random() * gameState.cols));
- if ( j == waveData.length ) { // Next Wave
- gameState.waveNumber += 1;
- gameState.waveProgress = 0;
- var waveModifier = 10; // Constant governing how much faster the next wave is to spawn (not fish speed)
- for (var k in waveData ) // Slightly faster
- if (waveData[k] > waveModifier)
- waveData[k] -= waveModifier;
- }
-
- // Towers Attack
- for (var j in gameState.towers) {
- var tower = gameState.towers[j];
- if (tower == null)
- continue;
- if (tower.fireCounter > 0) {
- tower.fireCounter -= 1;
- continue;
- }
- var column = tower.col;
- for (var k in gameState.mobs[column]) {
- var conflict = gameState.mobs[column][k];
- if (conflict.y <= gameState.canvas.height && conflict.y + conflict.height > tower.y
- && conflict.y - ((tower.row + 1) * gameState.squareSize) < gameState.squareSize * tower.range) { // In Range
- tower.fire();
- tower.fireCounter = tower.rof;
- conflict.hit(tower.damage);
- }
- }
-
- // Income
- if (tower.income) {
- gameState.coins += tower.income;
- tower.fire();
- tower.fireCounter = tower.rof;
- }
- }
-
- // Mobs move
- for (var i = 0; i < gameState.cols; i++) {
- for (var j = 0; j < gameState.mobs[i].length; j++) {
- var mob = gameState.mobs[i][j];
- var newPos = gameState.mobs[i][j].y - gameState.mobs[i][j].speed;
- if (newPos < 0) {
- gameState.lives -= 1;
- killMob(i, mob);
- if (gameState.lives <= 0)
- endGame();
- continue;
- }
- var conflict = gameState.towers[towerIdx(i, row(newPos))];
- if (conflict != null) {
- if (mob.y < conflict.y + gameState.squareSize)
- gameState.mobs[i][j].y += gameState.mobs[i][j].speed * 10; // Moved inside tower, now hurry back out
- if (mob.fireCounter > 0) {
- mob.fireCounter--;
- } else {
- gameState.mobs[i][j].fire();
- conflict.hp -= mob.damage;
- if (conflict.hp <= 0)
- killTower(conflict.row, conflict.col);
- mob.fireCounter = mob.rof;
- }
- } else {
- gameState.mobs[i][j].y = newPos;
- }
- }
- }
-
-}
diff --git a/examples/quick/demos/maroon/content/mobs/MobBase.qml b/examples/quick/demos/maroon/content/mobs/MobBase.qml
deleted file mode 100644
index 584623fa77..0000000000
--- a/examples/quick/demos/maroon/content/mobs/MobBase.qml
+++ /dev/null
@@ -1,272 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../logic.js" as Logic
-import ".."
-
-Item {
- id: container
- property string name: "Fish"
- property int col: 0
- property real hp: 3
- property real damage: 1
- property real speed: 0.25
- property int rof: 30 //In ticks
- property int fireCounter: 0
- property bool dying: false
- width: parent ? parent.squareSize : 0
- height: parent ? parent.squareSize : 0
- x: col * width
- z: 1001
- function fire() { }
-
- function die() {
- if (dying)
- return;
- dying = true;
- bubble.jumpTo("burst");
- if (fishSprite.currentSprite == "front")
- fishSprite.jumpTo(Math.random() > 0.5 ? "left" : "right" );
- fishSwim.start();
- Logic.gameState.score += 1;
- killedSound.play();
- bubble.scale = 0.9
- destroy(350);
- }
-
- function inked() {
- if (hp > 0)
- ink.jumpTo("dirty");
- }
-
- function hit(dmg) {
- hp -= dmg;
-
- if (hp <= 0)
- Logic.killMob(col, container);
- }
-
- Component.onCompleted: spawnSound.play()
-
- SoundEffect {
- id: spawnSound
- source: "../audio/catch.wav"
- }
- SoundEffect {
- id: killedSound
- source: "../audio/catch-action.wav"
- }
-
- SpriteSequence {
- id: fishSprite
- width: 64
- height: 64
- interpolate: false
- goalSprite: ""
-
- Sprite {
- name: "left"
- source: "../gfx/mob-idle.png"
- frameWidth: 64
- frameHeight: 64
- frameCount: 1
- frameDuration: 800
- frameDurationVariation: 400
- to: { "front" : 1 }
- }
-
- Sprite {
- name: "front"
- source: "../gfx/mob-idle.png"
- frameCount: 1
- frameX: 64
- frameWidth: 64
- frameHeight: 64
- frameDuration: 800
- frameDurationVariation: 400
- to: { "left" : 1, "right" : 1 }
- }
-
- Sprite {
- name: "right"
- source: "../gfx/mob-idle.png"
- frameCount: 1
- frameX: 128
- frameWidth: 64
- frameHeight: 64
- frameDuration: 800
- frameDurationVariation: 400
- to: { "front" : 1 }
- }
-
-
- Sprite { //WORKAROUND: This prevents the triggering of a rendering error which is currently under investigation.
- name: "dummy"
- source: "../gfx/melee-idle.png"
- frameCount: 8
- frameWidth: 64
- frameHeight: 64
- frameX: 0
- frameDuration: 200
- }
-
- NumberAnimation on x {
- id: fishSwim
- running: false
- property bool goingLeft: fishSprite.currentSprite == "right"
- to: goingLeft ? -360 : 360
- duration: 300
- }
- }
-
- SpriteSequence {
- id: bubble
- width: 64
- height: 64
- scale: 0.4 + (0.2 * hp)
- interpolate: false
- goalSprite: ""
-
- Behavior on scale {
- NumberAnimation { duration: 150; easing.type: Easing.OutBack }
- }
-
- Sprite {
- name: "big"
- source: "../gfx/catch.png"
- frameCount: 1
- to: { "burst" : 0 }
- }
-
- Sprite {
- name: "burst"
- source: "../gfx/catch-action.png"
- frameCount: 3
- frameX: 64
- frameDuration: 200
- }
-
- Sprite { //WORKAROUND: This prevents the triggering of a rendering error which is currently under investigation.
- name: "dummy"
- source: "../gfx/melee-idle.png"
- frameCount: 8
- frameWidth: 64
- frameHeight: 64
- frameX: 0
- frameDuration: 200
- }
- SequentialAnimation on width {
- loops: Animation.Infinite
- NumberAnimation { from: width * 1; to: width * 1.1; duration: 800; easing.type: Easing.InOutQuad }
- NumberAnimation { from: width * 1.1; to: width * 1; duration: 1000; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on height {
- loops: Animation.Infinite
- NumberAnimation { from: height * 1; to: height * 1.15; duration: 1200; easing.type: Easing.InOutQuad }
- NumberAnimation { from: height * 1.15; to: height * 1; duration: 1000; easing.type: Easing.InOutQuad }
- }
- }
-
- SpriteSequence {
- id: ink
- width: 64
- height: 64
- scale: bubble.scale
- goalSprite: ""
-
- Sprite {
- name: "clean"
- source: "../gfx/projectile-action.png"
- frameCount: 1
- frameX: 0
- frameWidth: 64
- frameHeight: 64
- }
- Sprite {
- name: "dirty"
- source: "../gfx/projectile-action.png"
- frameCount: 3
- frameX: 64
- frameWidth: 64
- frameHeight: 64
- frameDuration: 150
- to: {"clean":1}
- }
-
- Sprite { //WORKAROUND: This prevents the triggering of a rendering error which is currently under investigation.
- name: "dummy"
- source: "../gfx/melee-idle.png"
- frameCount: 8
- frameWidth: 64
- frameHeight: 64
- frameX: 0
- frameDuration: 200
- }
- SequentialAnimation on width {
- loops: Animation.Infinite
- NumberAnimation { from: width * 1; to: width * 1.1; duration: 800; easing.type: Easing.InOutQuad }
- NumberAnimation { from: width * 1.1; to: width * 1; duration: 1000; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on height {
- loops: Animation.Infinite
- NumberAnimation { from: height * 1; to: height * 1.15; duration: 1200; easing.type: Easing.InOutQuad }
- NumberAnimation { from: height * 1.15; to: height * 1; duration: 1000; easing.type: Easing.InOutQuad }
- }
-
- }
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: x; to: x - 5; duration: 900; easing.type: Easing.InOutQuad }
- NumberAnimation { from: x - 5; to: x; duration: 900; easing.type: Easing.InOutQuad }
- }
-}
-
diff --git a/examples/quick/demos/maroon/content/towers/Bomb.qml b/examples/quick/demos/maroon/content/towers/Bomb.qml
deleted file mode 100644
index e33d71d2e0..0000000000
--- a/examples/quick/demos/maroon/content/towers/Bomb.qml
+++ /dev/null
@@ -1,143 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../logic.js" as Logic
-import ".."
-
-TowerBase {
- id: container
- hp: 10
- range: 0.4
- rof: 10
- property real detonationRange: 2.5
-
- function fire() {
- sound.play()
- sprite.jumpTo("shoot")
- animDelay.start()
- }
-
- function finishFire() {
- var sCol = Math.max(0, col - 1)
- var eCol = Math.min(Logic.gameState.cols - 1, col + 1)
- var killList = new Array()
- for (var i = sCol; i <= eCol; i++) {
- for (var j = 0; j < Logic.gameState.mobs[i].length; j++)
- if (Math.abs(Logic.gameState.mobs[i][j].y - container.y) < Logic.gameState.squareSize * detonationRange)
- killList.push(Logic.gameState.mobs[i][j])
- while (killList.length > 0)
- Logic.killMob(i, killList.pop())
- }
- Logic.killTower(row, col);
- }
-
- Timer {
- id: animDelay
- running: false
- interval: shootState.frameCount * shootState.frameDuration
- onTriggered: finishFire()
- }
-
- function die()
- {
- destroy() // No blink, because we usually meant to die
- }
-
- SoundEffect {
- id: sound
- source: "../audio/bomb-action.wav"
- }
-
- SpriteSequence {
- id: sprite
- width: 64
- height: 64
- interpolate: false
- goalSprite: ""
-
- Sprite {
- name: "idle"
- source: "../gfx/bomb-idle.png"
- frameCount: 4
- frameDuration: 800
- }
-
- Sprite {
- id: shootState
- name: "shoot"
- source: "../gfx/bomb-action.png"
- frameCount: 6
- frameDuration: 155
- to: { "dying" : 1 } // So that if it takes a frame to clean up, it is on the last frame of the explosion
- }
-
- Sprite {
- name: "dying"
- source: "../gfx/bomb-action.png"
- frameCount: 1
- frameX: 64 * 5
- frameWidth: 64
- frameHeight: 64
- frameDuration: 155
- }
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: x; to: x + 4; duration: 900; easing.type: Easing.InOutQuad }
- NumberAnimation { from: x + 4; to: x; duration: 900; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on y {
- loops: Animation.Infinite
- NumberAnimation { from: y; to: y - 4; duration: 900; easing.type: Easing.InOutQuad }
- NumberAnimation { from: y - 4; to: y; duration: 900; easing.type: Easing.InOutQuad }
- }
- }
-}
diff --git a/examples/quick/demos/maroon/content/towers/Factory.qml b/examples/quick/demos/maroon/content/towers/Factory.qml
deleted file mode 100644
index 6b688e051a..0000000000
--- a/examples/quick/demos/maroon/content/towers/Factory.qml
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../logic.js" as Logic
-import ".."
-
-TowerBase {
- id: container
- rof: 160
- income: 5
- SpriteSequence {
- id: sprite
- width: 64
- height: 64
- interpolate: false
- goalSprite: ""
-
- Sprite {
- name: "idle"
- source: "../gfx/factory-idle.png"
- frameCount: 4
- frameDuration: 200
- }
-
- Sprite {
- name: "action"
- source: "../gfx/factory-action.png"
- frameCount: 4
- frameDuration: 90
- to: { "idle" : 1 }
- }
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: x; to: x + 4; duration: 900; easing.type: Easing.InOutQuad }
- NumberAnimation { from: x + 4; to: x; duration: 900; easing.type: Easing.InOutQuad }
- }
- SequentialAnimation on y {
- loops: Animation.Infinite
- NumberAnimation { from: y; to: y - 4; duration: 900; easing.type: Easing.InOutQuad }
- NumberAnimation { from: y - 4; to: y; duration: 900; easing.type: Easing.InOutQuad }
- }
- }
-
- SoundEffect {
- id: actionSound
- source: "../audio/factory-action.wav"
- }
-
- function fire() {
- actionSound.play()
- sprite.jumpTo("action")
- coinLaunch.start()
- }
-
- function spawn() {
- coin.target = Logic.gameState.mapToItem(container, 240, -32)
- }
-
- Image {
- id: coin
- property var target: { "x" : 0, "y" : 0 }
- source: "../gfx/currency.png"
- visible: false
- }
-
- SequentialAnimation {
- id: coinLaunch
- PropertyAction { target: coin; property: "visible"; value: true }
- ParallelAnimation {
- NumberAnimation { target: coin; property: "x"; from: 16; to: coin.target.x }
- NumberAnimation { target: coin; property: "y"; from: 16; to: coin.target.y }
- }
- PropertyAction { target: coin; property: "visible"; value: false }
- }
-}
diff --git a/examples/quick/demos/maroon/content/towers/Melee.qml b/examples/quick/demos/maroon/content/towers/Melee.qml
deleted file mode 100644
index f83bd4c525..0000000000
--- a/examples/quick/demos/maroon/content/towers/Melee.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 ".."
-
-TowerBase {
- hp: 4
- range: 0.1
- damage: 1
- rof: 40
- income: 0
-
- SpriteSequence {
- id: sprite
- width: 64
- height: 64
- interpolate: false
- goalSprite: ""
-
- Sprite {
- name: "idle"
- source: "../gfx/melee-idle.png"
- frameCount: 8
- frameDuration: 250
- }
-
- Sprite {
- name: "shoot"
- source: "../gfx/melee-action.png"
- frameCount: 2
- frameDuration: 200
- to: { "idle" : 1 }
- }
- }
-
- function fire() {
- shootSound.play()
- sprite.jumpTo("shoot")
- }
-
- SoundEffect {
- id: shootSound
- source: "../audio/melee-action.wav"
- }
-}
diff --git a/examples/quick/demos/maroon/content/towers/Ranged.qml b/examples/quick/demos/maroon/content/towers/Ranged.qml
deleted file mode 100644
index 2c1f5d1343..0000000000
--- a/examples/quick/demos/maroon/content/towers/Ranged.qml
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../logic.js" as Logic
-import ".."
-
-TowerBase {
- id: container
- hp: 2
- range: 6
- damage: 0 // By projectile
- rof: 40
- income: 0
- property var targetMob
- property real realDamage: 1
- function fire() {
- proj.x = 32 - proj.width / 2
- proj.y = 0
- targetMob = Logic.gameState.mobs[col][0]
- projAnim.to = targetMob.y - container.y -10
- projAnim.start()
- shootSound.play()
- sprite.jumpTo("shoot")
- }
-
- Image {
- id: proj
- y: 1000
- SequentialAnimation on y {
- id: projAnim
- running: false
- property real to: 1000
- SmoothedAnimation {
- to: projAnim.to
- velocity: 400
- }
- ScriptAction {
- script: {
- if (targetMob && targetMob.hit) {
- targetMob.hit(realDamage)
- targetMob.inked()
- projSound.play()
- }
- }
- }
- PropertyAction {
- value: 1000;
- }
- }
- source: "../gfx/projectile.png"
- }
-
- SoundEffect {
- id: shootSound
- source: "../audio/shooter-action.wav"
- }
- SoundEffect {
- id: projSound
- source: "../audio/projectile-action.wav"
- }
-
- SpriteSequence {
- id: sprite
- width: 64
- height: 64
- interpolate: false
- goalSprite: ""
-
- Sprite {
- name: "idle"
- source: "../gfx/shooter-idle.png"
- frameCount: 4
- frameDuration: 250
- }
-
- Sprite {
- name: "shoot"
- source: "../gfx/shooter-action.png"
- frameCount: 5
- frameDuration: 90
- to: { "idle" : 1 }
- }
-
- SequentialAnimation on x {
- loops: Animation.Infinite
- NumberAnimation { from: x; to: x - 4; duration: 900; easing.type: Easing.InOutQuad }
- NumberAnimation { from: x - 4; to: x; duration: 900; easing.type: Easing.InOutQuad }
- }
- }
-}
diff --git a/examples/quick/demos/maroon/content/towers/TowerBase.qml b/examples/quick/demos/maroon/content/towers/TowerBase.qml
deleted file mode 100644
index be37d732e4..0000000000
--- a/examples/quick/demos/maroon/content/towers/TowerBase.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 {
- property real hp: 1
- property real range: 0
- property real damage: 0
- property int rof: 100
- property int fireCounter: 0
- property int income: 0
- property int row: 0
- property int col: 0
-
- width: parent ? parent.squareSize : 0
- height: parent ? parent.squareSize : 0
- //This is how it is placed on the gameboard, do not modify/animate the X/Y/Z of a TowerBase please
- x: col * width
- y: row * height
- z: 1000
-
- function fire() { }
- function spawn() { } //After all game properties are set
- function die() { stdDeath.start(); destroy(1000); }
- function sell() { destroy(); }
-
- SequentialAnimation on opacity {
- id: stdDeath
- running: false
- loops: 2
- NumberAnimation { from: 1; to: 0; }
- NumberAnimation { from: 0; to: 1; }
- }
-}
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png
deleted file mode 100644
index 6d41179c23..0000000000
--- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-1.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png
deleted file mode 100644
index c8f37486f6..0000000000
--- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-2.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpg
deleted file mode 100644
index a83e282d5f..0000000000
--- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-3.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpg
deleted file mode 100644
index 8a6063b7c7..0000000000
--- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-4.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpg
deleted file mode 100644
index e3e4a2ec89..0000000000
--- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-5.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpg b/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpg
deleted file mode 100644
index ad6b4bf156..0000000000
--- a/examples/quick/demos/maroon/doc/images/qtquick-demo-maroon-med-6.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/maroon/doc/src/maroon.qdoc b/examples/quick/demos/maroon/doc/src/maroon.qdoc
deleted file mode 100644
index e6f0a25238..0000000000
--- a/examples/quick/demos/maroon/doc/src/maroon.qdoc
+++ /dev/null
@@ -1,889 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Maroon in Trouble
- \ingroup qtquickdemos
- \example demos/maroon
- \brief A Qt Quick game for touch devices that uses SpriteSequence,
- ParticleSystem, Emitter, and Wander types to animate objects and the SoundEffect type to
- play sound effects.
-
- \image qtquick-demo-maroon-med-2.png
-
- \e{Maroon in Trouble} demonstrates QML features that are useful when
- developing games:
-
- \list
- \li Using custom QML types to create different screens for
- different stages of the game.
- \li Using the \l Item and \l Image types to construct a game background.
- \li Using the SequentialAnimation, NumberAnimation, ParticleSystem,
- \l Emitter, and \l Wander types to animate background objects.
- \li Using the \l Timer and \l Repeater types to display a countdown
- sequence before starting the game.
- \li Using a custom QML type with custom properties to construct a game
- board.
- \li Using the SpriteSequence and \l Sprite types to add animated objects
- to the game board.
- \li Using a custom QML type that uses the \l Image type with some custom
- properties to add a menu where the players can buy objects.
- \li Using custom properties with private functions to keep track of game
- statistics and a custom QML type to display them to the players.
- \li Using the \l State type with JavaScript functions to manage game
- states.
- \li Using the \l SoundEffect type to play individual sound effects
- depending on the object type and the action applied to the object.
- \li Using signal handlers to specify keyboard shortcuts for some game
- actions.
- \li Using resource files to package game resources for deployment and
- delivery.
- \endlist
-
- \include examples-run.qdocinc
-
- \section1 Adding Screens
-
- In the Maroon in Trouble app, we use the following custom types that
- are each defined in a separate .qml file to create the game screens:
-
- \list
- \li NewGameScreen.qml
- \li GameCanvas.qml
- \li GameOverScreen.qml
- \endlist
-
- To use the custom types, we add an import statement to the main QML file,
- maroon.qml that imports the folder called \c content where the types are
- located:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto content
- \printuntil "
-
- We use the screen types at different stages of the game. The NewGameScreen
- type is used to create the screen that appears when the players start the
- app. In NewGameScreen.qml, we use an \l{Image} type to create a New Game
- button that the players can press to start a new game.
-
- \image qtquick-demo-maroon-med-1.png
-
- Tapping the button initiates a countdown timer that triggers the creation
- of the game canvas by using the GameCanvas type. Another \l{Timer} type
- spawns mobs of fish inside bubbles that the players must free before they
- reach the surface. The players can tap on the screen to open a menu where
- they can buy different types of weapons (melee, ranged, and bombs) to burst
- the bubbles.
-
- \image qtquick-demo-maroon-med-2.png
-
- When the game finishes, a screen created by using the GameOverScreen type
- appears. On this screen, the players can see their score and start a new
- game.
-
- \image qtquick-demo-maroon-med-3.jpg
-
- The screens are all created on the same background and use some of the same
- images and animations.
-
- \section1 Constructing the Background
-
- In the maroon.qml file, we use an \l{Item} type with the id \c root and a
- fixed width and height to create a main window for the game:
-
- \skipto Item
- \printuntil passedSplash
-
- We declare two custom properties for the root item, \c gameState and
- \c passedSplash that we will use later to manage game states.
-
- We use an \l{Image} item to display the game background image:
-
- \printuntil anchors.bottom
-
- We want to be able to load the background image only once at app startup
- and still use different scenes for the game screens. Therefore,
- background.png is three times the length of the root item and displays a
- scene that stretches from the bottom of sea to the sky above the horizon.
-
- We use the \c anchors.bottom property to anchor the background image to the
- bottom of the \l{Column} layout that we use to position the screens:
-
- \skipto Column
- \printuntil GameOverScreen
-
- We set a negative value for the \c y property to set the first scene at the
- bottom of the sea. We calculate the position by subtracting the height of
- a screen from the \c height property.
-
- Within the column layout, we use an \l{Item} type to add objects to the
- background. Within the item, we use \l{Row} layout objects to position
- \l{Image} objects that display waves on the game canvas and the game over
- screen:
-
- \printuntil }
- \printuntil }
- \dots
- \skipto Row
- \printuntil }
- \printuntil }
-
- The second row of waves is positioned on the y axis with a slight offset to
- the first row. We also use the \c opacity property to make the waves appear
- lighter in color than the first two waves, which gives the background some
- depth.
-
- We use \l{Image} objects to also display sunlight on the new game screen and
- on the game canvas:
-
- \skipto Image
- \printuntil anchors
- \dots
- \skipto Image
- \printuntil anchors
-
- We set the \c opacity property of the images to \c 0.02 and \c 0.04 to give
- some depth to the rays of sunshine. We use the \c y property to position the
- images at fixed locations on the y axis and the
- \c {anchors.horizontalCenter} property to center them horizontally in
- relation to their parent.
-
- We use an \l {Image} type to display an image that adds a deepening shadow
- to the background:
-
- \skipto Image
- \printuntil }
-
- We set the \c opacity property of the image to \c 0.5 to make the background
- visible behind the shadow.
-
- To make the background more interesting, we animate some of the objects we
- added to it.
-
- \section1 Animating Background Objects
-
- We use NumberAnimation to move the waves horizontally across the screen in
- opposite directions and SequentialAnimation with NumberAnimation to move
- them up and down.
-
- We apply the number animation to the \c x property of \c wave as a property
- value source to animate the x value from its current value to the
- \c -(wave.width), over 16 seconds. We set the \c loops property to
- \c {Animation.Infinite} to repeat the animation indefinitely:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto wave.width
- \printuntil }
-
- We apply the sequential animation to the \c y property of the image as a
- property value source to animate the y value. We use one number animation
- to animate the image from the y position of two below the value of y to two
- above it, over 1600 milliseconds. We use another number animation to
- subsequently animate the image in the opposite direction, again over 1600
- milliseconds. The animation is repeated indefinitely:
-
- \skipto SequentialAnimation
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use the easing curve of the type \c {Easing.InOutQuad} for a quintic
- (t^5) function to accelerate the motion until halfway and then decelerate
- it.
-
- We use sequential animation and number animation to animate \c wave2
- similarly to \c wave, but in the opposite direction:
-
- \skipto SequentialAnimation
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use sequential animation to rotate the rays of sunlight in degrees
- clockwise around an origin point that we set to \c {Item.Top} in the
- \c transformOrigin property. The animation is repeated indefinitely:
-
- \skipto transformOrigin
- \printuntil to: -10
- \printuntil }
-
- We use one number animation to rotate the image from \c -10 degrees to
- \c 10 degrees over 8 seconds and another to subsequently rotate it from
- \c 10 degrees to \c -10 degrees over the same duration.
-
- We use the easing curve of the type \c {Easing.InOutSine} for a sinusoidal
- (sin(t)) function to accelerate the motion until halfway and then decelerate
- it.
-
- We use sequential animation and number animation to animate another
- sunlight.png image similarly, but in the opposite direction:
-
- \skipto transformOrigin
- \printuntil to: 10
- \printuntil }
-
- For examples of using SequentialAnimation and NumberAnimation on the \c x
- and \c y properties and the \c width and \c height properties, see
- NewGameScreen.qml.
-
- \section1 Emitting Particles
-
- In addition to animation, we use particles to generate motion on the game
- screens. We use the ParticleSystem QML type in maroon.qml to make bubbles
- appear at the bottom of the new game screen and game canvas and slowly float
- towards the top on varying trajectories.
-
- To use the ParticleSystem type, we must import \l{Qt Quick Particles QML Types}:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto Particles
- \printuntil 0
-
- To have the particles appear on the game background, we place the
- ParticleSystem type within the \l{Image} type that displays the game
- background:
-
- \skipto Image
- \printuntil anchors.fill
-
- In the ParticleSystem, we use an \l{Emitter} type to emit particles from the
- location of the emitter at the rate of two per second with the life span of
- 15 seconds:
-
- \skipto Emitter
- \printuntil sizeVariation
- \printuntil }
-
- The \c acceleration property uses the PointDirection type to
- specify random variation of the x and y coordinates, so that the bubbles
- appear inside a rectangular area around the emitter that is anchored to the
- bottom of the image.
-
- The \c size property sets the base size of the particles at the beginning of
- their life to 24 pixels and the \c sizeVariation property randomly increases
- or decreases the particle size by up to 16 pixels, so that we get bubbles in
- different sizes.
-
- As emitters have no visualization, we use the ImageParticle type to render
- the catch.png image at the particle location:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto ImageParticle
- \printuntil }
-
- A \l{Wander} type applies a random trajectory to the particles, so that the
- bubbles follow random routes from the bottom to the top.
-
- \printuntil }
-
- For another example of using the ParticleSystem type, see the
- GameOverScreen.qml file, where an ImageParticle type is used to make clouds
- move across the sky.
-
- \section1 Using Timers
-
- \image qtquick-demo-maroon-med-4.jpg
-
- In maroon.qml, we use the \l{Timer} type with a \l{Repeater} type to display
- a countdown sequence before using another timer to start a new game. Both
- timers are started simultaneously in the \c "gameOn" state, that is when the
- players tap the New Game button and \c passedSplash is \c true. This is
- explained in more detail in \l{Managing Game States}.
-
- We use the \c countdownTimer to display the countdown sequence:
-
- \skipto Timer
- \printuntil }
-
- The \c onTriggered signal handler is called when the timer is triggered to
- increment the value of the \c countdown custom property.
-
- We set the \c repeat property to \c true to specify that the timer is
- triggered at the interval of 1 second as long as the value of \c countdown
- is less than 5.
-
- The \c countdown property is defined in the root item with an initial value
- of \c 10, so that \c countdownTimer is not running by default:
-
- \skipto countdown:
- \printuntil 10
-
- Each time the timer is triggered, an image from the countdown sequence is
- displayed. We use a \l{Repeater} type to instantiate the \l{Image} delegate
- in the context of the repeater's parent, \c canvasArea item, seeded with
- data from the \c model:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto Repeater
- \printuntil scale
- \printuntil }
- \printuntil }
- \printuntil }
- \printuntil }
-
- We scale the images from \c 0.0 to \c 1.0 and use the \c visible property to
- hide the images for the previous steps as the countdown progresses. We also
- raise the opacity of the image that matches the current countdown step,
- keeping the others nearly transparent.
-
- By animating the changes in the \c opacity and \c scale properties using a
- \l Behavior type, we achieve a countdown sequence where numbers zoom in
- towards the players.
-
- \section1 Constructing the Game Board
-
- To construct the game board, we use the GameCanvas custom type that is
- defined in GameCanvas.qml.
-
- In maroon.qml, we use the GameCanvas type to display the game canvas
- at the position of 32 on the x axis and 20 pixels from the bottom of
- its parent item, \c canvasArea:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto GameCanvas
- \printuntil }
-
- We set the \c focus property to \c true to give \c canvas active focus on
- startup.
-
- In GameCanvas.qml, we use an \l Item type and define custom properties for
- it to create a grid of equally sized squares divided to 4 columns on 6 rows:
-
- \quotefromfile demos/maroon/content/GameCanvas.qml
- \skipto Item
- \printuntil canvas
-
- We use the custom properties to set the \c width and \c height of the
- \c grid item as the amount of columns and rows multiplied by square size:
-
- \skipto width
- \printuntil height
-
- We use an \l{Image} type with a MouseArea type to display a help button
- that the players can tap to view an image that contains instructions for
- playing the game:
-
- \skipuntil endGame
- \skipto Image
- \printuntil bottomMargin
- \printuntil }
-
- We declare the \c goAway() private function to disable the mouse area and
- make the image fully transparent and a \c comeBack() function to enable the
- mouse area and make the button fully opaque. We use a \l {Behavior} type on
- the \c opacity property to apply the default number animation when the value
- of \c opacity changes.
-
- When the players tap the help button, the \c onClicked signal handler is
- called to hide the help button by setting the \c {helpButton.visible}
- property to \c false and to show the help image by setting the
- \c {helpImage.visible} property to \c false.
-
- \image qtquick-demo-maroon-med-6.jpg
-
- We use anchoring to position the help button at the bottom center of the
- game canvas.
-
- We use another \l{Image} type to display the help image:
-
- \printuntil }
- \printuntil }
-
- To hide the help image when the players tap it, the \c onClicked signal
- handler within the MouseArea type is called to set the \c{helpImage.visible}
- property to \c true.
-
- To ensure that the images are placed on top when they are visible, we set
- a high value for their \c z property.
-
- The following sections describe how to use timers to add animated objects to
- the game board and how to create a menu dialog from which the players can
- add more objects to it.
-
- \section1 Animating Objects on the Game Board
-
- We use sprite animation to animate objects on the game board. The Qt Quick
- \l{Sprite Animations}{sprite engine} is a stochastic state machine combined
- with the ability to chop up images containing multiple frames of an
- animation.
-
- \section2 Spawning Fish
-
- We use a \l{Timer} element with the \c tick() function in GameCanvas.qml to
- spawn mobs of fish in waves at an increasing rate, starting at 16
- milliseconds:
-
- \quotefromfile demos/maroon/content/GameCanvas.qml
- \skipto Timer
- \printuntil }
-
- We use the MobBase custom type that is defined in MobBase.qml to
- animate mobs of fish that swim inside bubbles. We use an \l{Item} type with
- custom properties and private functions to create the fish and the bubbles
- and to define the actions that can be applied to them:
-
- \quotefromfile demos/maroon/content/mobs/MobBase.qml
- \skipto Item
- \printuntil }
- \dots
-
- We use a SpriteSequence type to animate the fish:
-
- \skipto SpriteSequence
- \printuntil goalSprite
-
- The SpriteSequence type renders and controls a list of animations
- defined by \l{Sprite} types:
-
- \skipto Sprite {
- \printuntil name: "right"
- \printuntil }
- \printuntil }
-
- In the \c fishSprite sprite sequence, each sprite defines one frame within
- the mob-idle.png file, which shows a fish facing right, front, and left:
-
- \image ../../content/gfx/mob-idle.png
-
- We use the \c frameWidth, \c frameHeight, and \c frameX properties to
- determine that the first 64x64-pixel square of the image is framed in the
- \c "left" sprite, the second in the \c "front" sprite, and the third in the
- \c "right" sprite. For each sprite, the \c frameCount property is set to
- \c 1 to specify that the sprite contains one frame.
-
- We use the \c frameDuration and \c frameDurationVariation properties to
- specify that the duration of an animation can vary from \c 400 to \c 1200
- milliseconds.
-
- The \c to property specifies that the sprites have weighted transitions to
- other sprites. The \c "left" and \c "right" sprites always transfer to the
- \c "front" sprite. When the \c "front" animation finishes, the sprite engine
- chooses \c "left" or \c "right" randomly, but at roughly equal proportions,
- because they both have the weight \c 1.
-
- When the fish are set free, we want them to swim away in the direction they
- are facing until they get off the screen. If they were facing front, we use
- the \c jumpTo method with the JavaScript \c {Math.random()} method in the
- \c die() private function to randomly jump to the \c "left" or \c "right"
- sprite:
-
- \quotefromfile demos/maroon/content/mobs/MobBase.qml
- \skipto die()
- \printuntil }
-
- We then use the \c start() function to run a NumberAnimation that applies a
- number animation to the x value from its current value to \c -360 or \c 360,
- depending on whether the \c goingLeft custom property is \c true, in 300
- milliseconds:
-
- \skipto NumberAnimation
- \printuntil }
-
- \section2 Bursting Bubbles
-
- We use another SpriteSequence to animate the bubbles so that they
- become smaller and finally burst when they are attacked by a shooter or
- a melee. For this effect, we set the value of the \c scale property to
- decrease by \c 0.2 each time the custom \c hp property changes:
-
- \skipto SpriteSequence
- \printuntil goalSprite
-
- We use a \l{Behavior} type to apply a NumberAnimation when the value of
- \c scale changes. We use the \c{Easing.OutBack} easing type for a back
- (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out curve that
- decelerates the motion to zero velocity in 150 milliseconds:
-
- \skipto Behavior
- \printuntil }
- \printuntil }
-
- The SpriteSequence consist of two sprites that display different images. The
- first sprite, \c "big", uses the catch.png image to display an empty bubble:
-
- \skipto Sprite
- \printuntil }
- \printuntil }
-
- We set the \c to property to \c "burst" with the weight \c 0 to make the
- second sprite, \c "burst", a valid goal for the \c jumpTo method that we use
- in the \c die() private function to jump directly to the \c "burst" sprite
- without playing the first sprite.
-
- In the \c "burst" sprite, we set the \c frameCount property to \c 3 and the
- \c frameX property to \c 64 to specify that the animation starts at pixel
- location 64 and loads each frame for the duration of 200 milliseconds.
-
- \skipto Sprite
- \printuntil }
-
- Within the SpriteSequence, we use SequentialAnimation with NumberAnimation
- to animate the transitions between the frames. To create a pulsating effect
- on the bubbles, we apply a sequential animation on the \c width property
- with two number animations to first increase the bubble width from
- \c{* 1} to \c{* 1.1} over 800 milliseconds and then bring it back over 1
- second:
-
- \skipto SequentialAnimation
- \printuntil }
- \printuntil }
- \printuntil }
-
- Similarly, we increase the bubble height from \c{* 1} to \c{* 1.15} over
- 1200 milliseconds and then bring it back over 1 second:
-
- \skipto SequentialAnimation
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use yet another SpriteSequence to display the effect of squid ink on the
- bubbles. For more examples of using sprite sequences, see the QML files in
- the \c towers directory.
-
- \section1 Adding Dialogs
-
- \image qtquick-demo-maroon-med-5.jpg
-
- In GameCanvas.qml, we use an \l{Image} type with some custom properties to
- create a menu where the players can buy tower objects:
-
- \quotefromfile demos/maroon/content/GameCanvas.qml
- \skipto Image
- \printuntil towerExists
-
- We set the \c visible property to \c false to hide the menu by default. The
- \c z property is set to 1500 to ensure that the menu is displayed in front
- of all other items when it is visible.
-
- We use a MouseArea type to open or close the menu when players tap on the
- canvas:
-
- \quotefromfile demos/maroon/content/GameCanvas.qml
- \skipto MouseArea
- \printuntil }
- \printuntil }
-
- We set the \c anchors.fill property to \c parent to allow the players to tap
- anywhere on the game canvas. We use a condition in the \c onClicked
- signal handler to call the \c {finish()} function if the menu is visible
- and the \c {open()} function otherwise.
-
- The \c {finish()} function hides the menu by setting the \c shown custom
- property to \c false:
-
- \skipto finish
- \printuntil }
-
- The \c {open()} function displays the menu at the x and y position of the
- mouse pointer:
-
- \printuntil }
-
- If \c gameRunning is \c true, we call the JavaScript \c row() function to
- calculate the value of the \c targetRow custom property and the \c col()
- function to calculate the value of the \c targetCol custom property. If
- the value of \c targetRow equals \c 0, the y position is set to one square
- above the mouse pointer. Otherwise, it is set to one square below the mouse
- pointer.
-
- We use the \c towerIdx() function to set the value of the \c towerExists
- custom property.
-
- We set the \c shown custom property to \c true to show the menu and call the
- \c {helpButton.goAway()} function to hide the help button when the menu
- opens.
-
- We use states and transitions to display the menu when the \c shown
- property is \c true and the \c gameOver property is \c false:
-
- \printuntil OutElastic
- \printuntil }
-
- To set the visibility of the menu to \c "visible" without animating the
- property change, we use a PropertyAction type. We do want to animate the
- changes in opacity and scale, though, so we use number animation to
- animate the value of the \c scale property from \c 0.9 to \c 1 and the
- value of \c opacity property from \c 0.7 to \c 1, over 500 milliseconds.
- We use the \c {Easing.outElastic} easing type for an elastic (exponentially
- decaying sine wave) function easing curve that decelerates from zero
- velocity.
-
- To construct the menu, we use a BuildButton custom type that is defined in
- BuildButton.qml. In GameCanvas.qml, we create one build button for each
- tower object that the players can buy and position them in a \l{Row} layout
- in front of the menu background image, dialog.png:
-
- \printuntil dialog-factory.png
- \printuntil }
- \printuntil }
- \printuntil }
-
- For each build button, we set the values of \c towerType and \c index custom
- properties that we define in BuildButton.qml.
-
- We use the \c canBuild custom property to prevent players from adding tower
- objects in locations where tower objects already exist.
-
- We use the \c source property to display the image for the tower type.
-
- The \c onClicked signal handler is called to execute the \c finish()
- function that closes the menu when the players tap an enabled build button.
-
- Build buttons are enabled when the players have enough coins to buy the
- tower objects. We use an \l {Image} type in BuildButton.qml to display
- images on the buttons:
-
- \quotefromfile demos/maroon/content/BuildButton.qml
- \skipto Image
- \printuntil }
-
- We use the \c opacity property to make the buttons appear enabled. If
- \c canBuild is \c true and the value of the \c gameCanvas.coins property
- is larger than or equal to the cost of a tower object, the images are fully
- opaque, otherwise their opacity is set to \c 0.4.
-
- We use a \l{Text} type to display the cost of each tower item, as specified
- by the \c towerData variable, depending on \c towerType:
-
- \skipto Text
- \printuntil }
-
- To display a pointer on the screen at the position where the tower object
- will be added, we use the \l {Image} type. We use the \c visible property
- to determine whether the dialog-pointer.png image should be positioned below
- or above the menu. When the value of the \c col property equals the \c index
- and the value or the \c row property is not \c 0, we anchor the image to the
- bottom of its parent, BuildButton.
-
- When the value or the \c row property is \c 0, we anchor the image to the
- top of BuildButton to position the pointer above the menu and use the
- \c rotation property to rotate it by 180 degrees, so that it points upwards:
-
- \skipto Image
- \printuntil }
- \printuntil }
-
- \section1 Keeping Track of Game Statistics
-
- To keep track of the game statistics, we use the InfoBar custom type (that
- is defined in InfoBar.qml) in maroon.qml:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto InfoBar
- \printuntil }
-
- We use the \c {anchors.bottom} and \c {anchors.bottomMargin} properties to
- position the info bar at 6 points from the top of the game canvas. We bind
- the \c width property of the info bar to that of its parent.
-
- In InfoBar.qml, we use an \l{Item} type to create the info bar. Within it,
- we use a \l{Row} layout type to display the number of lives the players have
- left, the number of fish that have been saved, and the amount of coins that
- are available for use.
-
- We use the \c anchors property to position the rows in relationship to their
- parent and to each other. In the first \l{Row} object, we use the
- \c {anchors.left} and \c {anchors.leftMargin} properties to position the
- heart icons at 10 points from the left border of the parent item:
-
- \quotefromfile demos/maroon/content/InfoBar.qml
- \skipto Item
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use a \l{Repeater} type with a \c model and a \c delegate to display as
- many hearts as the players have lives left. We use the \c spacing property
- to leave 5 pixels between the displayed icons.
-
- In the second \l{Row} object, we use the \c {anchors.right} and
- \c {anchors.rightMargin} properties to position the number of fish saved at
- 20 points left of the third \l{Row} object that displays the number of coins
- available (and has the id \c points):
-
- \skipto Row
- \printuntil /^\}/
-
- In these objects, we set spacing to 5 pixels to separate the icons from the
- numbers that we display by using a \l{Text} type.
-
- In GameCanvas.qml, we define custom properties to hold the game statistics:
-
- \quotefromfile demos/maroon/content/GameCanvas.qml
- \skipto score
- \printuntil lives
-
- We declare the \c freshState() function to set the initial game statistics
- when a new game starts:
-
- \skipto freshState()
- \printuntil }
-
- We use the \c {Logic.gameState.score} variable in the \c die() function
- that we declare in MobBase.qml to increase the score by one when the players
- set a fish free:
-
- \quotefromfile demos/maroon/content/mobs/MobBase.qml
- \skipto score
- \printuntil ;
-
- \section1 Managing Game States
-
- In maroon.qml, we use a \l{State} type and JavaScript to switch between
- screens according to the game state. The logic.js file contains definitions
- for the functions. To use the functions in a QML file, we import logic.js as
- the \c Logic namespace in that file:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto logic.js
- \printuntil Logic
-
- The base state displays the new game screen when the application starts.
- In addition, we call the Component.onCompleted signal handler to initialize
- a new game:
-
- \skipto newGameState
- \printuntil ;
-
- In NewGameScreen.qml we use the \c onClicked signal handler to emit the
- \c startButtonClicked() signal when the players tap the New Game button:
-
- \quotefromfile demos/maroon/content/NewGameScreen.qml
- \skipto to: 150
- \skipto Image
- \printuntil }
-
- In maroon.qml, we use the \c onStartButtonClicked signal handler to set the
- \c passedSplash property of the \c root item to \c true:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto NewGameScreen
- \printuntil }
-
- We then use the \c passedSplash property in the \c when property of the
- \c gameOn state to trigger the \c gameStarter timer:
-
- \skipto State {
- \printuntil gameStarter
- \printuntil }
-
- We also switch to the \c "gameOn" state and move to the y position
- \c {-(height - 960)} to display the game canvas.
-
- In the \c gameStarter \l{Timer} object we use the \c onTriggered signal
- handler to call the \c startGame() function that starts a new game:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto property int
- \skipto Timer
- \printuntil }
-
- The game continues until \c gameState.gameOver is set to \c true and
- \c gameState.gameRunning is set to \c false by calling the \c endGame()
- function when the value of the \c gameState.lives property becomes less
- than or equal to \c 0.
-
- In GameOverScreen.qml, we use a MouseArea type and an \c onClicked signal
- handler within an \l{Image} type to return to the game canvas when the
- players tap the New Game button:
-
- \quotefromfile demos/maroon/content/GameOverScreen.qml
- \skipto opacity: 0.5
- \skipto Image
- \printuntil }
- \printuntil }
-
- The \c onClicked signal handler triggers a state change in maroon.qml to
- display the game canvas:
-
- \quotefromfile demos/maroon/maroon.qml
- \skipto target: gameStarter
- \skipto State
- \printuntil }
- \printuntil }
-
- \section1 Playing Sound Effects
-
- The app can play sound effects if the \l{Qt Multimedia} module is installed.
- In the SoundEffect.qml file, we proxy a SoundEffect type:
-
- \quotefromfile demos/maroon/content/SoundEffect.qml
- \skipto Item
- \printuntil }
- \printuntil }
-
- We add the \c qtHaveModule() qmake command to the app .pro file, maroon.pro,
- to check whether the \l{Qt Multimedia} module is present:
-
- \quotefromfile demos/maroon/maroon.pro
- \skipto QT
- \printuntil multimedia
-
- In each QML file that defines a custom type used on the game canvas, we
- use a SoundEffect type to specify the audio file to play for that type
- of objects. For example, in Bomb.qml, we specify the sound that a bomb
- makes when it explodes:
-
- \quotefromfile demos/maroon/content/towers/Bomb.qml
- \skipto SoundEffect
- \printuntil }
-
- To play the sound effect when a bomb explodes, we call the \c sound.play()
- function that we declare as a member of the private \c fire() function
- within the TowerBase custom type:
-
- \quotefromfile demos/maroon/content/towers/Bomb.qml
- \skipto fire()
- \printuntil }
-
- For more examples of playing sound effects, see the QML files in the
- \c towers directory and MobBase.qml.
-
- \section1 Adding Keyboard Shortcuts
-
- This is a touch example, so you should not really need to handle key
- presses. However, we do not want you to have to spend more time playing the
- game than you want to while testing it, so we use the \c {Keys.onPressed}
- signal handler to specify keyboard shortcuts. You can press Shift+Up to
- increment the values of the \c coins property to add coins, Shift+Left to
- increment the value of \c lives, Shift+Down to increment the value of the
- \c waveProgress property to spawn mobs of fish faster, and Shift+Right to
- call the \c endGame() function to quit the game:
-
- \quotefromfile demos/maroon/content/GameCanvas.qml
- \skipto Keys
- \printuntil }
-
- \section1 Packaging Resources for Deployment
-
- To be able to run the app on mobile devices, we package all QML, JavaScript,
- image, and sound files into a Qt resource file (.qrc). For more information,
- see \l{The Qt Resource System}.
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/maroon/main.cpp b/examples/quick/demos/maroon/main.cpp
deleted file mode 100644
index f6590fc32e..0000000000
--- a/examples/quick/demos/maroon/main.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/maroon/maroon)
diff --git a/examples/quick/demos/maroon/maroon.pro b/examples/quick/demos/maroon/maroon.pro
deleted file mode 100644
index ada16d047a..0000000000
--- a/examples/quick/demos/maroon/maroon.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick
-qtHaveModule(multimedia): QT += multimedia
-SOURCES += main.cpp
-RESOURCES += maroon.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/maroon
-INSTALLS += target
diff --git a/examples/quick/demos/maroon/maroon.qml b/examples/quick/demos/maroon/maroon.qml
deleted file mode 100644
index d05ef57b64..0000000000
--- a/examples/quick/demos/maroon/maroon.qml
+++ /dev/null
@@ -1,245 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-import "content"
-import "content/logic.js" as Logic
-
-Item {
- id: root
- width: 320
- height: 480
- property var gameState
- property bool passedSplash: false
-
- Image {
- source:"content/gfx/background.png"
- anchors.bottom: view.bottom
-
- ParticleSystem {
- id: particles
- anchors.fill: parent
-
- ImageParticle {
- id: bubble
- anchors.fill: parent
- source: "content/gfx/catch.png"
- opacity: 0.25
- }
-
- Wander {
- xVariance: 25;
- pace: 25;
- }
-
- Emitter {
- width: parent.width
- height: 150
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 3
- startTime: 15000
-
- emitRate: 2
- lifeSpan: 15000
-
- acceleration: PointDirection{ y: -6; xVariation: 2; yVariation: 2 }
-
- size: 24
- sizeVariation: 16
- }
- }
- }
-
- Column {
- id: view
- y: -(height - 480)
- width: 320
-
- GameOverScreen { gameCanvas: canvas }
-
- Item {
- id: canvasArea
- width: 320
- height: 480
-
- Row {
- height: childrenRect.height
- Image {
- id: wave
- y: 30
- source:"content/gfx/wave.png"
- }
- Image {
- y: 30
- source:"content/gfx/wave.png"
- }
- NumberAnimation on x { from: 0; to: -(wave.width); duration: 16000; loops: Animation.Infinite }
- SequentialAnimation on y {
- loops: Animation.Infinite
- NumberAnimation { from: y - 2; to: y + 2; duration: 1600; easing.type: Easing.InOutQuad }
- NumberAnimation { from: y + 2; to: y - 2; duration: 1600; easing.type: Easing.InOutQuad }
- }
- }
-
- Row {
- opacity: 0.5
- Image {
- id: wave2
- y: 25
- source: "content/gfx/wave.png"
- }
- Image {
- y: 25
- source: "content/gfx/wave.png"
- }
- NumberAnimation on x { from: -(wave2.width); to: 0; duration: 32000; loops: Animation.Infinite }
- SequentialAnimation on y {
- loops: Animation.Infinite
- NumberAnimation { from: y + 2; to: y - 2; duration: 1600; easing.type: Easing.InOutQuad }
- NumberAnimation { from: y - 2; to: y + 2; duration: 1600; easing.type: Easing.InOutQuad }
- }
- }
-
- Image {
- source: "content/gfx/sunlight.png"
- opacity: 0.02
- y: 0
- anchors.horizontalCenter: parent.horizontalCenter
- transformOrigin: Item.Top
- SequentialAnimation on rotation {
- loops: Animation.Infinite
- NumberAnimation { from: -10; to: 10; duration: 8000; easing.type: Easing.InOutSine }
- NumberAnimation { from: 10; to: -10; duration: 8000; easing.type: Easing.InOutSine }
- }
- }
-
- Image {
- source: "content/gfx/sunlight.png"
- opacity: 0.04
- y: 20
- anchors.horizontalCenter: parent.horizontalCenter
- transformOrigin: Item.Top
- SequentialAnimation on rotation {
- loops: Animation.Infinite
- NumberAnimation { from: 10; to: -10; duration: 8000; easing.type: Easing.InOutSine }
- NumberAnimation { from: -10; to: 10; duration: 8000; easing.type: Easing.InOutSine }
- }
- }
-
- Image {
- source: "content/gfx/grid.png"
- opacity: 0.5
- }
-
- GameCanvas {
- id: canvas
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 20
- x: 32
- focus: true
- }
-
- InfoBar { anchors.bottom: canvas.top; anchors.bottomMargin: 6; width: parent.width }
-
- //3..2..1..go
- Timer {
- id: countdownTimer
- interval: 1000
- running: root.countdown < 5
- repeat: true
- onTriggered: root.countdown++
- }
- Repeater {
- model: ["content/gfx/text-blank.png", "content/gfx/text-3.png", "content/gfx/text-2.png", "content/gfx/text-1.png", "content/gfx/text-go.png"]
- delegate: Image {
- visible: root.countdown <= index
- opacity: root.countdown == index ? 0.5 : 0.1
- scale: root.countdown >= index ? 1.0 : 0.0
- source: modelData
- Behavior on opacity { NumberAnimation {} }
- Behavior on scale { NumberAnimation {} }
- }
- }
- }
-
- NewGameScreen {
- onStartButtonClicked: root.passedSplash = true
- }
- }
-
- property int countdown: 10
- Timer {
- id: gameStarter
- interval: 4000
- running: false
- repeat: false
- onTriggered: Logic.startGame(canvas);
- }
-
- states: [
- State {
- name: "gameOn"; when: gameState.gameOver == false && passedSplash
- PropertyChanges { target: view; y: -(height - 960) }
- StateChangeScript { script: root.countdown = 0; }
- PropertyChanges { target: gameStarter; running: true }
- },
- State {
- name: "gameOver"; when: gameState.gameOver == true
- PropertyChanges { target: view; y: 0 }
- }
- ]
-
- transitions: Transition {
- NumberAnimation { properties: "x,y"; duration: 1200; easing.type: Easing.OutQuad }
- }
-
- Component.onCompleted: gameState = Logic.newGameState(canvas);
-}
diff --git a/examples/quick/demos/maroon/maroon.qmlproject b/examples/quick/demos/maroon/maroon.qmlproject
deleted file mode 100644
index 752666114f..0000000000
--- a/examples/quick/demos/maroon/maroon.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "maroon.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-}
diff --git a/examples/quick/demos/maroon/maroon.qrc b/examples/quick/demos/maroon/maroon.qrc
deleted file mode 100644
index 52c2a4e513..0000000000
--- a/examples/quick/demos/maroon/maroon.qrc
+++ /dev/null
@@ -1,71 +0,0 @@
-<RCC>
- <qresource prefix="/demos/maroon">
- <file>maroon.qml</file>
- <file>content/BuildButton.qml</file>
- <file>content/GameCanvas.qml</file>
- <file>content/GameOverScreen.qml</file>
- <file>content/InfoBar.qml</file>
- <file>content/logic.js</file>
- <file>content/NewGameScreen.qml</file>
- <file>content/SoundEffect.qml</file>
- <file>content/audio/bomb-action.wav</file>
- <file>content/audio/catch-action.wav</file>
- <file>content/audio/catch.wav</file>
- <file>content/audio/currency.wav</file>
- <file>content/audio/factory-action.wav</file>
- <file>content/audio/melee-action.wav</file>
- <file>content/audio/projectile-action.wav</file>
- <file>content/audio/shooter-action.wav</file>
- <file>content/gfx/background.png</file>
- <file>content/gfx/bomb-action.png</file>
- <file>content/gfx/bomb-idle.png</file>
- <file>content/gfx/bomb.png</file>
- <file>content/gfx/button-help.png</file>
- <file>content/gfx/button-play.png</file>
- <file>content/gfx/catch-action.png</file>
- <file>content/gfx/catch.png</file>
- <file>content/gfx/cloud.png</file>
- <file>content/gfx/currency.png</file>
- <file>content/gfx/dialog-bomb.png</file>
- <file>content/gfx/dialog-factory.png</file>
- <file>content/gfx/dialog-melee.png</file>
- <file>content/gfx/dialog-pointer.png</file>
- <file>content/gfx/dialog-shooter.png</file>
- <file>content/gfx/dialog.png</file>
- <file>content/gfx/factory-action.png</file>
- <file>content/gfx/factory-idle.png</file>
- <file>content/gfx/factory.png</file>
- <file>content/gfx/grid.png</file>
- <file>content/gfx/help.png</file>
- <file>content/gfx/lifes.png</file>
- <file>content/gfx/logo-bubble.png</file>
- <file>content/gfx/logo-fish.png</file>
- <file>content/gfx/logo.png</file>
- <file>content/gfx/melee-action.png</file>
- <file>content/gfx/melee-idle.png</file>
- <file>content/gfx/melee.png</file>
- <file>content/gfx/mob-idle.png</file>
- <file>content/gfx/mob.png</file>
- <file>content/gfx/points.png</file>
- <file>content/gfx/projectile-action.png</file>
- <file>content/gfx/projectile.png</file>
- <file>content/gfx/scores.png</file>
- <file>content/gfx/shooter-action.png</file>
- <file>content/gfx/shooter-idle.png</file>
- <file>content/gfx/shooter.png</file>
- <file>content/gfx/sunlight.png</file>
- <file>content/gfx/text-1.png</file>
- <file>content/gfx/text-2.png</file>
- <file>content/gfx/text-3.png</file>
- <file>content/gfx/text-blank.png</file>
- <file>content/gfx/text-gameover.png</file>
- <file>content/gfx/text-go.png</file>
- <file>content/gfx/wave.png</file>
- <file>content/mobs/MobBase.qml</file>
- <file>content/towers/Bomb.qml</file>
- <file>content/towers/Factory.qml</file>
- <file>content/towers/Melee.qml</file>
- <file>content/towers/Ranged.qml</file>
- <file>content/towers/TowerBase.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png b/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
deleted file mode 100644
index a0cd823999..0000000000
--- a/examples/quick/demos/photosurface/doc/images/qtquick-demo-photosurface-small.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc b/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
deleted file mode 100644
index dd1b2fe79f..0000000000
--- a/examples/quick/demos/photosurface/doc/src/photosurface.qdoc
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Photo Surface
- \ingroup qtquickdemos
- \example demos/photosurface
- \brief A QML app for touch devices that uses a Repeater with a
- FolderListModel to access content in a folder, and a PinchArea that contains
- a MouseArea to handle pinch gestures on the fetched content.
- \image qtquick-demo-photosurface-small.png
-
- \e{Photo Surface} demonstrates how to use a \l{Repeater} with a
- FolderListModel and a FileDialog to access images from a folder selected
- by a user and how to handle dragging, rotation and pinch zooming within the
- same item using a \l PinchArea that contains a \l MouseArea.
-
- All the app code is contained in one QML file, photosurface.qml. Inline
- JavaScript code is used to place, rotate, and scale images on the photo
- surface.
-
- \include examples-run.qdocinc
-
- \section1 Creating the Main Window
-
- To create the main window for the Photo Surface app, we use the \l{Window}
- QML type as the root item. It automatically sets up the window for use with
- \l{Qt Quick} graphical types:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto Window {
- \printuntil currentFrame
-
- To use the \l{Window} type, we must import it:
-
- \code
- import QtQuick.Window 2.1
- \endcode
-
- \section1 Accessing Folder Contents
-
- We use a \l{Repeater} QML type together with the FolderListModel to display
- GIF, JPG, and PNG images located in a folder:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto Repeater
- \printuntil }
-
- To use the FolderListModel type, we must import it:
-
- \code
- import Qt.labs.folderlistmodel 1.0
- \endcode
-
- We use a FileDialog to enable users to select the folder that contains
- the images:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto FileDialog
- \printuntil }
-
- To use the FileDialog type, we must import \l{Qt Quick Dialogs}:
-
- \code
- import QtQuick.Dialogs 1.0
- \endcode
-
- We use the \c {fileDialog.open()} function to open the file dialog when the
- app starts:
-
- \code
- Component.onCompleted: fileDialog.open()
- \endcode
-
- Users can also click the file dialog icon to open the file dialog. We use
- an \l{Image} QML type to display the icon. Inside the \l{Image} type, we
- use a MouseArea with the \c onClicked signal handler to call the
- \c {fileDialog.open()} function:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipuntil Image {
- \skipto Image {
- \printuntil }
- \printuntil }
-
- \section1 Displaying Images on the Photo Surface
-
- We use a \l{Rectangle} as a delegate for a \l{Repeater} to provide a frame
- for each image that the FolderListModel finds in the selected folder. We use
- JavaScript \c Math() methods to place the frames randomly on the photo
- surface and to rotate them at random angles, as well as to scale the images:
-
- \quotefromfile demos/photosurface/photosurface.qml
- \skipto Rectangle
- \printuntil Component.onCompleted
- \printuntil }
-
- \section1 Handling Pinch Gestures
-
- We use a PinchArea that contains a MouseArea in the photo frames to handle
- dragging, rotation and pinch zooming of the frame:
-
- \skipto PinchArea
- \printuntil onPinchStarted
-
- We use the \c pinch group property to control how the photo frames react to
- pinch gestures. The \c pinch.target sets \c photoFrame as the item to
- manipulate. The rotation properties specify that the frames can be rotated
- at all angles and the scale properties specify that they can be scaled
- between \c 0.1 and \c 10.
-
- In the MouseArea's \c onPressed signal handler, we raise the selected photo
- frame to the top by increasing the value of its \c z property. The root item
- stores the z value of the top-most frame. The border color of the photo
- frame is controlled in the \c onEntered signal handler to highlight the
- selected image:
-
- \skipto MouseArea
- \printuntil onEntered
-
- To enable you to test the example on the desktop, we use the MouseArea's
- \c onWheel signal handler to simulate pinch gestures by using a mouse:
-
- \printuntil photoFrame.scale
- \printuntil }
- \printuntil }
-
- The \c onWheel signal handler is called in response to mouse wheel gestures.
- Use the vertical wheel to zoom and Ctrl and the vertical wheel to rotate
- frames. If the mouse has a horizontal wheel, use it to rotate frames.
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/photosurface/main.cpp b/examples/quick/demos/photosurface/main.cpp
deleted file mode 100644
index d1522bd09c..0000000000
--- a/examples/quick/demos/photosurface/main.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-#ifdef QT_WIDGETS_LIB
-#include <QtWidgets/QApplication>
-#else
-#include <QtGui/QGuiApplication>
-#endif
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtQuick/QQuickWindow>
-#include <QtGui/QImageReader>
-#include <QtCore/QCommandLineParser>
-#include <QtCore/QCommandLineOption>
-#include <QtCore/QDebug>
-#include <QtCore/QDir>
-#include <QtCore/QMimeDatabase>
-#include <QtCore/QStandardPaths>
-#include <QtCore/QUrl>
-
-static QStringList imageNameFilters()
-{
- QStringList result;
- QMimeDatabase mimeDatabase;
- const auto supportedMimeTypes = QImageReader::supportedMimeTypes();
- for (const QByteArray &m : supportedMimeTypes) {
- const auto suffixes = mimeDatabase.mimeTypeForName(m).suffixes();
- for (const QString &suffix : suffixes)
- result.append(QLatin1String("*.") + suffix);
- }
- return result;
-}
-
-int main(int argc, char* argv[])
-{
- // The reason to use QApplication is that QWidget-based dialogs
- // are the native dialogs on Qt-based platforms like KDE,
- // but they cannot be instantiated if this is a QGuiApplication.
-#ifdef QT_WIDGETS_LIB
- QApplication app(argc, argv);
-#else
- QGuiApplication app(argc, argv);
-#endif
- QQuickWindow::setDefaultAlphaBuffer(true);
-
- QCoreApplication::setApplicationName(QStringLiteral("Photosurface"));
- QCoreApplication::setOrganizationName(QStringLiteral("QtProject"));
- QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR));
- QCommandLineParser parser;
- parser.setApplicationDescription(QStringLiteral("Qt Quick Demo - Photo Surface"));
- parser.addHelpOption();
- parser.addVersionOption();
- parser.addPositionalArgument(QStringLiteral("directory"),
- QStringLiteral("The image directory or URL to show."));
- parser.process(app);
-
- QUrl initialUrl;
- if (!parser.positionalArguments().isEmpty()) {
- initialUrl = QUrl::fromUserInput(parser.positionalArguments().first(),
- QDir::currentPath(), QUrl::AssumeLocalFile);
- if (!initialUrl.isValid()) {
- qWarning().nospace() << "Invalid argument: \""
- << parser.positionalArguments().first() << "\": " << initialUrl.errorString();
- return 1;
- }
- }
-
- const QStringList nameFilters = imageNameFilters();
-
- QQmlApplicationEngine engine;
- QQmlContext *context = engine.rootContext();
-
- QUrl picturesLocationUrl = QUrl::fromLocalFile(QDir::homePath());
- const QStringList picturesLocations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
- if (!picturesLocations.isEmpty()) {
- picturesLocationUrl = QUrl::fromLocalFile(picturesLocations.first());
- if (initialUrl.isEmpty()
- && !QDir(picturesLocations.first()).entryInfoList(nameFilters, QDir::Files).isEmpty()) {
- initialUrl = picturesLocationUrl;
- }
- }
-
- context->setContextProperty(QStringLiteral("contextPicturesLocation"), picturesLocationUrl);
- context->setContextProperty(QStringLiteral("contextInitialUrl"), initialUrl);
- context->setContextProperty(QStringLiteral("contextImageNameFilters"), nameFilters);
-
- engine.load(QUrl("qrc:///photosurface.qml"));
- if (engine.rootObjects().isEmpty())
- return -1;
-
- return app.exec();
-}
diff --git a/examples/quick/demos/photosurface/photosurface.pro b/examples/quick/demos/photosurface/photosurface.pro
deleted file mode 100644
index 5e5b0f0815..0000000000
--- a/examples/quick/demos/photosurface/photosurface.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick
-qtHaveModule(widgets): QT += widgets
-SOURCES += main.cpp
-RESOURCES += photosurface.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/photosurface
-INSTALLS += target
-ICON = resources/icon.png
-macx: ICON = resources/photosurface.icns
-win32: RC_FILE = resources/photosurface.rc
-
diff --git a/examples/quick/demos/photosurface/photosurface.qml b/examples/quick/demos/photosurface/photosurface.qml
deleted file mode 100644
index 5d1445d776..0000000000
--- a/examples/quick/demos/photosurface/photosurface.qml
+++ /dev/null
@@ -1,286 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.6
-import QtQuick.Dialogs 1.0
-import QtQuick.Window 2.1
-import Qt.labs.folderlistmodel 1.0
-
-Window {
- id: root
- visible: true
- width: 1024; height: 600
- color: "black"
- property int highestZ: 0
- property real defaultSize: 200
- property var currentFrame: undefined
- property real surfaceViewportRatio: 1.5
-
- FileDialog {
- id: fileDialog
- title: "Choose a folder with some images"
- selectFolder: true
- folder: picturesLocation
- onAccepted: folderModel.folder = fileUrl + "/"
- }
-
- Flickable {
- id: flick
- anchors.fill: parent
- contentWidth: width * surfaceViewportRatio
- contentHeight: height * surfaceViewportRatio
- Repeater {
- model: FolderListModel {
- id: folderModel
- objectName: "folderModel"
- showDirs: false
- nameFilters: imageNameFilters
- }
- Rectangle {
- id: photoFrame
- width: image.width * (1 + 0.10 * image.height / image.width)
- height: image.height * 1.10
- scale: defaultSize / Math.max(image.sourceSize.width, image.sourceSize.height)
- Behavior on scale { NumberAnimation { duration: 200 } }
- Behavior on x { NumberAnimation { duration: 200 } }
- Behavior on y { NumberAnimation { duration: 200 } }
- border.color: "black"
- border.width: 2
- smooth: true
- antialiasing: true
- Component.onCompleted: {
- x = Math.random() * root.width - width / 2
- y = Math.random() * root.height - height / 2
- rotation = Math.random() * 13 - 6
- }
- Image {
- id: image
- anchors.centerIn: parent
- fillMode: Image.PreserveAspectFit
- source: folderModel.folder + fileName
- antialiasing: true
- }
- PinchArea {
- anchors.fill: parent
- pinch.target: photoFrame
- pinch.minimumRotation: -360
- pinch.maximumRotation: 360
- pinch.minimumScale: 0.1
- pinch.maximumScale: 10
- pinch.dragAxis: Pinch.XAndYAxis
- onPinchStarted: setFrameColor();
- property real zRestore: 0
- onSmartZoom: {
- if (pinch.scale > 0) {
- photoFrame.rotation = 0;
- photoFrame.scale = Math.min(root.width, root.height) / Math.max(image.sourceSize.width, image.sourceSize.height) * 0.85
- photoFrame.x = flick.contentX + (flick.width - photoFrame.width) / 2
- photoFrame.y = flick.contentY + (flick.height - photoFrame.height) / 2
- zRestore = photoFrame.z
- photoFrame.z = ++root.highestZ;
- } else {
- photoFrame.rotation = pinch.previousAngle
- photoFrame.scale = pinch.previousScale
- photoFrame.x = pinch.previousCenter.x - photoFrame.width / 2
- photoFrame.y = pinch.previousCenter.y - photoFrame.height / 2
- photoFrame.z = zRestore
- --root.highestZ
- }
- }
-
- MouseArea {
- id: dragArea
- hoverEnabled: true
- anchors.fill: parent
- drag.target: photoFrame
- scrollGestureEnabled: false // 2-finger-flick gesture should pass through to the Flickable
- onPressed: {
- photoFrame.z = ++root.highestZ;
- parent.setFrameColor();
- }
- onEntered: parent.setFrameColor();
- onWheel: {
- if (wheel.modifiers & Qt.ControlModifier) {
- photoFrame.rotation += wheel.angleDelta.y / 120 * 5;
- if (Math.abs(photoFrame.rotation) < 4)
- photoFrame.rotation = 0;
- } else {
- photoFrame.rotation += wheel.angleDelta.x / 120;
- if (Math.abs(photoFrame.rotation) < 0.6)
- photoFrame.rotation = 0;
- var scaleBefore = photoFrame.scale;
- photoFrame.scale += photoFrame.scale * wheel.angleDelta.y / 120 / 10;
- }
- }
- }
- function setFrameColor() {
- if (currentFrame)
- currentFrame.border.color = "black";
- currentFrame = photoFrame;
- currentFrame.border.color = "red";
- }
- }
- }
- }
- }
-
- Rectangle {
- id: verticalScrollDecorator
- anchors.right: parent.right
- anchors.margins: 2
- color: "cyan"
- border.color: "black"
- border.width: 1
- width: 5
- radius: 2
- antialiasing: true
- height: flick.height * (flick.height / flick.contentHeight) - (width - anchors.margins) * 2
- y: (flick.contentY - flick.originY) * (flick.height / flick.contentHeight)
- NumberAnimation on opacity { id: vfade; to: 0; duration: 500 }
- onYChanged: { opacity = 1.0; scrollFadeTimer.restart() }
- }
-
- Rectangle {
- id: horizontalScrollDecorator
- anchors.bottom: parent.bottom
- anchors.margins: 2
- color: "cyan"
- border.color: "black"
- border.width: 1
- height: 5
- radius: 2
- antialiasing: true
- width: flick.width * (flick.width / flick.contentWidth) - (height - anchors.margins) * 2
- x: (flick.contentX - flick.originY) * (flick.width / flick.contentWidth)
- NumberAnimation on opacity { id: hfade; to: 0; duration: 500 }
- onXChanged: { opacity = 1.0; scrollFadeTimer.restart() }
- }
-
- Timer { id: scrollFadeTimer; interval: 1000; onTriggered: { hfade.start(); vfade.start() } }
-
- Image {
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.margins: 10
- source: "resources/folder.png"
- MouseArea {
- anchors.fill: parent
- anchors.margins: -10
- onClicked: fileDialog.open()
- hoverEnabled: true
- onPositionChanged: {
- tooltip.visible = false
- hoverTimer.start()
- }
- onExited: {
- tooltip.visible = false
- hoverTimer.stop()
- }
- Timer {
- id: hoverTimer
- interval: 1000
- onTriggered: {
- tooltip.x = parent.mouseX
- tooltip.y = parent.mouseY
- tooltip.visible = true
- }
- }
- Rectangle {
- id: tooltip
- border.color: "black"
- color: "beige"
- width: tooltipText.implicitWidth + 8
- height: tooltipText.implicitHeight + 8
- visible: false
- Text {
- id: tooltipText
- anchors.centerIn: parent
- text: "Open an image directory (" + openShortcut.sequenceString + ")"
- }
- }
- }
- Shortcut {
- id: openShortcut
- sequence: StandardKey.Open
- onActivated: fileDialog.open()
- }
- }
-
- Text {
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: 10
- color: "darkgrey"
- wrapMode: Text.WordWrap
- font.pointSize: 8
- text: "On a touchscreen: use two fingers to zoom and rotate, one finger to drag\n" +
- "With a mouse: drag normally, use the vertical wheel to zoom, horizontal wheel to rotate, or hold Ctrl while using the vertical wheel to rotate"
- }
-
- Shortcut { sequence: StandardKey.Quit; onActivated: Qt.quit() }
-
- Component.onCompleted: {
- if (typeof contextInitialUrl !== 'undefined') {
- // Launched from C++ with context properties set.
- imageNameFilters = contextImageNameFilters;
- picturesLocation = contextPicturesLocation;
- if (contextInitialUrl == "")
- fileDialog.open();
- else
- folderModel.folder = contextInitialUrl + "/";
- } else {
- // Launched via QML viewer without context properties set.
- fileDialog.open();
- }
- }
-
- property var imageNameFilters : ["*.png", "*.jpg", "*.gif"];
- property string picturesLocation : "";
-}
diff --git a/examples/quick/demos/photosurface/photosurface.qmlproject b/examples/quick/demos/photosurface/photosurface.qmlproject
deleted file mode 100644
index ae2065f59c..0000000000
--- a/examples/quick/demos/photosurface/photosurface.qmlproject
+++ /dev/null
@@ -1,20 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "photosurface.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/quick/demos/photosurface/photosurface.qrc b/examples/quick/demos/photosurface/photosurface.qrc
deleted file mode 100644
index f8fafbb1ff..0000000000
--- a/examples/quick/demos/photosurface/photosurface.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>photosurface.qml</file>
- <file>resources/folder.png</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/photosurface/resources/folder.png b/examples/quick/demos/photosurface/resources/folder.png
deleted file mode 100644
index 2aec3b6ebf..0000000000
--- a/examples/quick/demos/photosurface/resources/folder.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/icon.png b/examples/quick/demos/photosurface/resources/icon.png
deleted file mode 100644
index f8ff553fcb..0000000000
--- a/examples/quick/demos/photosurface/resources/icon.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/photosurface.icns b/examples/quick/demos/photosurface/resources/photosurface.icns
deleted file mode 100644
index c69ec41c4e..0000000000
--- a/examples/quick/demos/photosurface/resources/photosurface.icns
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/photosurface.ico b/examples/quick/demos/photosurface/resources/photosurface.ico
deleted file mode 100644
index 03bb7ee367..0000000000
--- a/examples/quick/demos/photosurface/resources/photosurface.ico
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photosurface/resources/photosurface.rc b/examples/quick/demos/photosurface/resources/photosurface.rc
deleted file mode 100644
index 3267bd033f..0000000000
--- a/examples/quick/demos/photosurface/resources/photosurface.rc
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "winver.h"
-
-IDI_ICON1 ICON DISCARDABLE "photosurface.ico"
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 1,0,0,0
- FILEFLAGS 0x0L
- FILEFLAGSMASK 0x3fL
- FILEOS 0x00040004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "000004b0"
- BEGIN
- VALUE "CompanyName", "The Qt Company Ltd"
- VALUE "FileDescription", "Photo Surface Demo"
- VALUE "FileVersion", "1.0.0.0"
- VALUE "LegalCopyright", "Copyright (C) 2015 The Qt Company Ltd."
- VALUE "InternalName", "photosurface"
- VALUE "OriginalFilename", "photosurface.exe"
- VALUE "ProductName", "Photo Surface Demo"
- VALUE "ProductVersion", "1.0.0.0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x0, 1200
- END
-END
diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
deleted file mode 100644
index ea72302d74..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.XmlListModel 2.0
-import QtQml.Models 2.1
-
-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
-
- DelegateModel {
- 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/quick/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml
deleted file mode 100644
index 836abdf6a9..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/BusyIndicator.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 {
- 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/quick/demos/photoviewer/PhotoViewerCore/Button.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/Button.qml
deleted file mode 100644
index cd575f6d99..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/Button.qml
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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: 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'
- border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
- }
-
- Image { anchors.fill: parent; source: "images/cardboard.png"; antialiasing: true }
-
- Rectangle {
- anchors.fill: container; color: container.tint; visible: container.tint != ""
- opacity: 0.25
- }
-
- Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent }
-
- MouseArea {
- anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
- onClicked: container.clicked()
- }
-}
diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/EditableButton.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/EditableButton.qml
deleted file mode 100644
index 35df4107eb..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/EditableButton.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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: container
-
- property string label
- signal clicked
-
- 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';
- border.left: 10; border.top: 10; border.right: 10; border.bottom: 10
- }
-
- Image { anchors.fill: parent; source: "images/cardboard.png"; antialiasing: true }
-
- TextInput {
- id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent
- Keys.onReturnPressed: {
- container.label = textInput.text
- container.focus = true
- }
- Keys.onEnterPressed: {
- container.label = 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; antialiasing: true
- }
-
- MouseArea {
- anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 }
- onClicked: { textInput.forceActiveFocus(); Qt.inputMethod.show(); }
- }
-}
diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml
deleted file mode 100644
index 2dcfc6158e..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml
+++ /dev/null
@@ -1,198 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "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'
- 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; antialiasing: true
- width: w * s; height: h * s; visible: originalImage.status != Image.Ready
- Rectangle {
- color: "#878787"; antialiasing: true
- anchors { fill: parent; topMargin: 3; bottomMargin: 3; leftMargin: 3; rightMargin: 3 }
- }
- }
- Rectangle {
- id: border; color: 'white'; anchors.centerIn: parent; antialiasing: true
- width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6
- visible: !placeHolder.visible
- }
- BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready }
- Image {
- id: originalImage; antialiasing: true;
- source: "http://" + Script.getImagePath(content); cache: false
- fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height
- }
- Image {
- id: hqImage; antialiasing: 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/quick/demos/photoviewer/PhotoViewerCore/ProgressBar.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/ProgressBar.qml
deleted file mode 100644
index 73f7f10ace..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/ProgressBar.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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: 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/quick/demos/photoviewer/PhotoViewerCore/RssModel.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/RssModel.qml
deleted file mode 100644
index 5808090250..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/RssModel.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 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/quick/demos/photoviewer/PhotoViewerCore/Tag.qml b/examples/quick/demos/photoviewer/PhotoViewerCore/Tag.qml
deleted file mode 100644
index aff9f6fb3b..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/Tag.qml
+++ /dev/null
@@ -1,100 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-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/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.png b/examples/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.png
deleted file mode 100644
index 23c011d0ff..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/images/box-shadow.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.png b/examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.png
deleted file mode 100644
index fc65122d26..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/images/busy.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.png b/examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.png
deleted file mode 100644
index a8a9c6079d..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/images/cardboard.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js b/examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js
deleted file mode 100644
index e8ef93a847..0000000000
--- a/examples/quick/demos/photoviewer/PhotoViewerCore/script/script.js
+++ /dev/null
@@ -1,27 +0,0 @@
-.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/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png b/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png
deleted file mode 100644
index d872310a3e..0000000000
--- a/examples/quick/demos/photoviewer/doc/images/qtquick-demo-photoviewer-small.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc b/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc
deleted file mode 100644
index da9029f817..0000000000
--- a/examples/quick/demos/photoviewer/doc/src/photoviewer.qdoc
+++ /dev/null
@@ -1,326 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Photo Viewer
- \ingroup qtquickdemos
- \example demos/photoviewer
- \brief A QML photo viewer that that uses XmlListModel and XmlRole to
- download Flickr feeds, and Package to display the photos in different views.
-
- \image qtquick-demo-photoviewer-small.png
-
- \e{Photo Viewer} demonstrates the following \l{Qt Quick} features:
-
- \list
- \li Using custom types to create screens and screen controls.
- \li Using Qt Quick Controls to create an application window.
- \li Using the \l Package type with a \l DelegateModel to provide
- delegates with a shared context to multiple views.
- \li Using XML list models to download Flickr feeds.
- \li Using the \l Flipable type to create labels with different text on
- the front and back.
- \li Using the PathView, \l Path, PathAttribute, and PathLine types to
- lay out photos on a path.
- \li Providing feedback to users while data is loading.
- \li Localizing applications.
- \endlist
-
- \include examples-run.qdocinc
-
- \section1 Using Custom Types
-
- In the Photo Viewer app, we use the following custom types that are each
- defined in a separate .qml file:
-
- \list
- \li \c AlbumDelegate.qml
- \li \c BusyIndicator.qml
- \li \c Button.qml
- \li \c EditableButton.qml
- \li \c PhotoDelegate.qml
- \li \c ProgressBar.qml
- \li \c RssModel.qml
- \li \c Tag.qml
- \endlist
-
- To use the custom types, we add an import statement to the main QML file,
- main.qml, that imports the folder called \c PhotoViewerCore where the types
- are located:
-
- \quotefromfile demos/photoviewer/main.qml
- \skipto PhotoViewerCore
- \printuntil "
-
- \section1 Creating the Main Window
-
- In main.qml, we use the ApplicationWindow Qt Quick Control to create the app
- main window:
-
- \printuntil visible
-
- We use a ListModel type with \l ListElement types to display photo albums:
-
- \skipto ListModel
- \printuntil Prague
- \printuntil }
-
- List elements are defined like other QML types except that they contain a
- collection of \e role definitions instead of properties. Roles both define
- how the data is accessed and include the data itself. For each list element,
- we use the \c tag role to specify the photos to download.
-
- A DelegateModel type is used together with the \l Package type to provide
- delegates to multiple views. The \c model property holds the model providing
- data for the delegate model and the \c delegate property specifies the
- template defining each item instantiated by a view:
-
- \printuntil DelegateModel
-
- We use a GridView type to lay out the albums as a grid:
-
- \printuntil }
-
- The \c model property references the package name \c album that we specify
- in AlbumDelegate.qml. We use the \l Package type to allow the photos to move
- between different views. The \l Package contains the named items \c browser,
- \c fullscreen, and \c album:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
- \skipto Package
- \printuntil albumWrapper
-
- The named items are used as the delegates by the views that reference the
- special DelegateModel::parts property to select the model that provides
- the chosen delegate.
-
- We use a ListView type to lay out albums in other views:
-
- \quotefromfile demos/photoviewer/main.qml
- \skipto ListView
- \printuntil }
- \skipto ListView
- \printuntil }
-
- \section1 Displaying Photos
-
- We use the PhotoDelegate custom type that is specified in PhotoDelegate.qml
- to display photos. We use a \l Package type to lay out the photos either in
- a stack, list, or a grid:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml
- \skipto Package
- \printuntil gridItem
-
- The photos are rotated at random angles by using the \c Math.random()
- JavaScript method:
-
- \printuntil stackItem
-
- We use a BorderImage type to create borders for the images:
-
- \printuntil border.left
- \printuntil }
-
- \section1 Downloading Flickr Feeds
-
- In AlbumDelegate.qml, we use the DelegateModel to provide the
- PhotoDelegate delegate to the RssModel model:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
- \skipto DelegateModel
- \printuntil RssModel
- \printuntil }
-
- In RssModel.qml, we use an XmlListModel type as a data source for
- \l Package objects to download photos from the selected feeds:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/RssModel.qml
- \skipto XmlListModel
- \printuntil encodeTags
-
- We use the \c tags custom property to specify which photos to download. The
- \c encodeTags custom function uses the \c encodeURIComponent JavaScript
- method to ensure that the requests to the server are correctly formatted.
-
- We use the \c source property to fetch photos that have the specified tags
- attached from public Flickr feeds:
-
- \printuntil namespaceDeclarations
-
- The \c query property specifies that the XmlListModel generates a model item
- for each feed entry.
-
- The \c namespaceDeclarations property specifies that the requested document
- uses the namespace \c{http://www.w3.org/2005/Atom}, which is declared as the
- default namespace.
-
- We use the XmlRole type to specify the model item attributes. Each model
- item has the \c title, \c content, and \c hq attributes that match the
- values of the corresponding feed entry:
-
- \printuntil hq
-
- \section1 Creating Flipable Labels
-
- When users select the \b Edit button, the album labels are flipped from
- their front side to their back side and the text on them changes from album
- name to \b Remove.
-
- In AlbumDelegate.qml, we use the Tag custom type to specify the text to
- display on the front and back sides of album labels:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
- \skipto Tag
- \printuntil onBackClicked
- \printuntil }
-
- The \c onTagChanged signal handler is used to change the tag based on
- which the model is populated. The \c onBackClicked signal handler is used to
- remove the album.
-
- In Tag.qml, we use a \l Flipable type with custom properties and signals to
- create the labels:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/Tag.qml
- \skipto Flipable
- \printuntil tagChanged
-
- The \c front property holds the EditableButton custom type that enables
- users to edit the label text:
-
- \printuntil onLabelChanged
- \printuntil }
-
- The \c back property holds the \c Button custom type that is used to remove
- the album:
-
- \printuntil onClicked
- \printuntil }
-
- \section1 Laying Out Photos on a Path
-
- In AlbumDelegate.qml, we use a PathView type to lay out the photos provided
- by the \c visualModel.parts.stack model on a path that has the form of a
- stack:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
- \skipto PathView
- \printuntil 0.0
- \printuntil }
- \printuntil }
-
- The \c path property holds the \l Path type that defines the path used by
- the PathView. The PathAttribute types are used to set a range of
- \c 0 to \c 9999 for the \c z attribute. This way, the path creates a stack
- of album photos. Because each PhotoDelegate is slightly rotated at a random
- angle, this results in a realistic-looking stack of photos.
-
- \section1 Providing Feedback to Users
-
- We use a busy indicator and a progress bar to indicate activity while
- Flickr feeds and photos are being loaded.
-
- In AlbumDelegate.qml, we use the \c BusyIndicator custom type and the
- \c on custom property to display a rotating image while the Flickr feed is
- being loaded:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/AlbumDelegate.qml
- \skipto BusyIndicator
- \printuntil rssModel
- \printuntil }
-
- In PhotoDelegate.qml, we use them to indicate activity while a photo is
- being loaded:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/PhotoDelegate.qml
- \skipto BusyIndicator
- \printuntil }
-
- We define the \c BusyIndicator type in \c BusyIndicator.qml. We use an
- \l Image type to display an image and apply a NumberAnimation to its
- \c rotation property to rotate the image in an infinite loop:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/BusyIndicator.qml
- \skipto Image
- \printuntil }
- \printuntil }
-
- In your apps, you can also use the BusyIndicator type from the
- \l {Qt Quick Controls} module.
-
- In main.qml, we use the \c ProgressBar custom type to indicate progress
- while a high quality version of a photo is being opened on full screen:
-
- \quotefromfile demos/photoviewer/main.qml
- \skipto ProgressBar
- \printuntil }
-
- We define the \c ProgressBar type in \c ProgressBar.qml. We use a
- \l Rectangle type to create the progress bar and apply a NumberAnimation to
- its \c opacity property to change the color of the bar from black to white
- as data loading proceeds:
-
- \quotefromfile demos/photoviewer/PhotoViewerCore/ProgressBar.qml
- \skipto Item
- \printuntil /^\}/
-
- In your apps, you can also use the ProgressBar type from the
- \l {Qt Quick Controls} module.
-
- \section1 Localizing Applications
-
- The example application is translated into German and French. The translated
- strings are loaded at runtime according to the current locale.
-
- We use a \l Column type in main.qml to position buttons for adding and
- editing albums and exiting the application:
-
- \quotefromfile demos/photoviewer/main.qml
- \skipto Column
- \printuntil quit()
- \printuntil }
- \printuntil }
-
- We use the \l[QML]{Qt::}{qsTr()} command to mark the button labels translatable.
-
- We use the \c lupdate() tool to generate the translation source files and
- the \c lrelease() tool to convert the translated strings to the QM files used
- by the application at runtime. These files are stored in the \c i18n
- directory.
-
- To make the application aware of the translations, we add code to the
- \c main() function in the main.cpp file. The code creates a \l QTranslator
- object, loads a translation according to the current locale at runtime, and
- installs the translator object into the application:
-
- \quotefromfile demos/photoviewer/main.cpp
- \skipto main
- \printuntil app.installTranslator
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/photoviewer/i18n/qml_de.qm b/examples/quick/demos/photoviewer/i18n/qml_de.qm
deleted file mode 100644
index 8186e7309f..0000000000
--- a/examples/quick/demos/photoviewer/i18n/qml_de.qm
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photoviewer/i18n/qml_de.ts b/examples/quick/demos/photoviewer/i18n/qml_de.ts
deleted file mode 100644
index 92ab50a136..0000000000
--- a/examples/quick/demos/photoviewer/i18n/qml_de.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1" language="de_DE">
-<context>
- <name>AlbumDelegate</name>
- <message>
- <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="102"/>
- <source>Remove</source>
- <translation>Entfernen</translation>
- </message>
-</context>
-<context>
- <name>main</name>
- <message>
- <location filename="../main.qml" line="75"/>
- <source>Add</source>
- <translation>Zufügen</translation>
- </message>
- <message>
- <location filename="../main.qml" line="84"/>
- <source>Edit</source>
- <translation>Bearbeiten</translation>
- </message>
- <message>
- <location filename="../main.qml" line="89"/>
- <source>Quit</source>
- <translation>Verlassen</translation>
- </message>
- <message>
- <location filename="../main.qml" line="102"/>
- <source>Back</source>
- <translation>Zurück</translation>
- </message>
-</context>
-</TS>
diff --git a/examples/quick/demos/photoviewer/i18n/qml_fr.qm b/examples/quick/demos/photoviewer/i18n/qml_fr.qm
deleted file mode 100644
index e4257d4073..0000000000
--- a/examples/quick/demos/photoviewer/i18n/qml_fr.qm
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/photoviewer/i18n/qml_fr.ts b/examples/quick/demos/photoviewer/i18n/qml_fr.ts
deleted file mode 100644
index 1edb5e0fe4..0000000000
--- a/examples/quick/demos/photoviewer/i18n/qml_fr.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1" language="fr_FR">
-<context>
- <name>AlbumDelegate</name>
- <message>
- <location filename="../PhotoViewerCore/AlbumDelegate.qml" line="102"/>
- <source>Remove</source>
- <translation>Supprimer</translation>
- </message>
-</context>
-<context>
- <name>main</name>
- <message>
- <location filename="../main.qml" line="75"/>
- <source>Add</source>
- <translation>Ajouter</translation>
- </message>
- <message>
- <location filename="../main.qml" line="84"/>
- <source>Edit</source>
- <translation>Éditer</translation>
- </message>
- <message>
- <location filename="../main.qml" line="89"/>
- <source>Quit</source>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <location filename="../main.qml" line="102"/>
- <source>Back</source>
- <translation>Retour</translation>
- </message>
-</context>
-</TS>
diff --git a/examples/quick/demos/photoviewer/main.cpp b/examples/quick/demos/photoviewer/main.cpp
deleted file mode 100644
index a269a61dcb..0000000000
--- a/examples/quick/demos/photoviewer/main.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 <QQmlApplicationEngine>
-#include <QTranslator>
-#include <QDebug>
-
-int main(int argc, char *argv[])
-{
- QGuiApplication app(argc, argv);
-
- QTranslator qtTranslator;
- qtTranslator.load("qml_" + QLocale::system().name(), ":/i18n/");
- app.installTranslator(&qtTranslator);
-
- QQmlApplicationEngine engine;
- engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
-
- return app.exec();
-}
diff --git a/examples/quick/demos/photoviewer/main.qml b/examples/quick/demos/photoviewer/main.qml
deleted file mode 100644
index 2e2b8e4ee2..0000000000
--- a/examples/quick/demos/photoviewer/main.qml
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-import QtQuick.Controls 1.1
-import QtQml.Models 2.1
-import "PhotoViewerCore"
-
-ApplicationWindow {
- id: mainWindow
-
- visible: true
-
- Rectangle {
- focus: true
-
- Keys.onBackPressed: {
- event.accepted = true
- backButton.clicked()
- }
- }
-
- 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" }
- }
-
- DelegateModel { 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
- visible: Qt.platform.os !== "android"
- }
-
- 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/quick/demos/photoviewer/photoviewer.pro b/examples/quick/demos/photoviewer/photoviewer.pro
deleted file mode 100644
index 68e43e13f9..0000000000
--- a/examples/quick/demos/photoviewer/photoviewer.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick xmlpatterns
-
-SOURCES += main.cpp
-
-lupdate_only{
-SOURCES = *.qml \
- PhotoViewerCore/*.qml \
- PhotoViewerCore/script/*.js
-}
-
-TRANSLATIONS += i18n/qml_fr.ts \
- i18n/qml_de.ts
-
-RESOURCES += qml.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/photoviewer
-INSTALLS += target
diff --git a/examples/quick/demos/photoviewer/qml.qrc b/examples/quick/demos/photoviewer/qml.qrc
deleted file mode 100644
index 8abefc6212..0000000000
--- a/examples/quick/demos/photoviewer/qml.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>main.qml</file>
- <file>PhotoViewerCore/AlbumDelegate.qml</file>
- <file>PhotoViewerCore/BusyIndicator.qml</file>
- <file>PhotoViewerCore/Button.qml</file>
- <file>PhotoViewerCore/EditableButton.qml</file>
- <file>PhotoViewerCore/PhotoDelegate.qml</file>
- <file>PhotoViewerCore/ProgressBar.qml</file>
- <file>PhotoViewerCore/RssModel.qml</file>
- <file>PhotoViewerCore/Tag.qml</file>
- <file>PhotoViewerCore/images/box-shadow.png</file>
- <file>PhotoViewerCore/images/busy.png</file>
- <file>PhotoViewerCore/images/cardboard.png</file>
- <file>PhotoViewerCore/script/script.js</file>
- <file>i18n/qml_fr.qm</file>
- <file>i18n/qml_de.qm</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/rssnews/content/BusyIndicator.qml b/examples/quick/demos/rssnews/content/BusyIndicator.qml
deleted file mode 100644
index 44b796bdfe..0000000000
--- a/examples/quick/demos/rssnews/content/BusyIndicator.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-
-Image {
- id: container
-
- source: "images/busy.png";
-
- NumberAnimation on rotation {
- running: container.visible
- from: 0; to: 360;
- loops: Animation.Infinite;
- duration: 1200
- }
-}
diff --git a/examples/quick/demos/rssnews/content/CategoryDelegate.qml b/examples/quick/demos/rssnews/content/CategoryDelegate.qml
deleted file mode 100644
index c76bc78aca..0000000000
--- a/examples/quick/demos/rssnews/content/CategoryDelegate.qml
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-
-Rectangle {
- id: delegate
-
- property bool selected: ListView.isCurrentItem
- property real itemSize
- width: itemSize
- height: itemSize
-
- Image {
- anchors.centerIn: parent
- source: image
- }
-
- Text {
- id: titleText
-
- anchors {
- left: parent.left; leftMargin: 20
- right: parent.right; rightMargin: 20
- top: parent.top; topMargin: 20
- }
-
- font { pixelSize: 18; bold: true }
- text: name
- color: selected ? "#ffffff" : "#ebebdd"
- scale: selected ? 1.15 : 1.0
- Behavior on color { ColorAnimation { duration: 150 } }
- Behavior on scale { PropertyAnimation { duration: 300 } }
- }
-
- BusyIndicator {
- scale: 0.8
- visible: delegate.ListView.isCurrentItem && window.loading
- anchors.centerIn: parent
- }
-
- MouseArea {
- anchors.fill: delegate
- onClicked: {
- delegate.ListView.view.currentIndex = index
- if (window.currentFeed == feed)
- feedModel.reload()
- else
- window.currentFeed = feed
- }
- }
-}
diff --git a/examples/quick/demos/rssnews/content/NewsDelegate.qml b/examples/quick/demos/rssnews/content/NewsDelegate.qml
deleted file mode 100644
index ed0c2bd977..0000000000
--- a/examples/quick/demos/rssnews/content/NewsDelegate.qml
+++ /dev/null
@@ -1,140 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-
-Column {
- id: delegate
- width: delegate.ListView.view.width
- spacing: 8
-
- // Returns a string representing how long ago an event occurred
- function timeSinceEvent(pubDate) {
- var result = pubDate;
-
- // We need to modify the pubDate read from the RSS feed
- // so the JavaScript Date object can interpret it
- var d = pubDate.replace(',','').split(' ');
- if (d.length != 6)
- return result;
-
- var date = new Date([d[0], d[2], d[1], d[3], d[4], 'GMT' + d[5]].join(' '));
-
- if (!isNaN(date.getDate())) {
- var age = new Date() - date;
- var minutes = Math.floor(Number(age) / 60000);
- if (minutes < 1440) {
- if (minutes < 2)
- result = qsTr("Just now");
- else if (minutes < 60)
- result = '' + minutes + ' ' + qsTr("minutes ago")
- else if (minutes < 120)
- result = qsTr("1 hour ago");
- else
- result = '' + Math.floor(minutes/60) + ' ' + qsTr("hours ago");
- }
- else {
- result = date.toDateString();
- }
- }
- return result;
- }
-
- Item { height: 8; width: delegate.width }
-
- Row {
- width: parent.width
- spacing: 8
-
- Column {
- Item {
- width: 4
- height: titleText.font.pixelSize / 4
- }
-
- Image {
- id: titleImage
- source: image
- }
- }
-
- Text {
- id: titleText
-
- text: title
- width: delegate.width - titleImage.width
- wrapMode: Text.WordWrap
- font.pixelSize: 26
- font.bold: true
- }
- }
-
- Text {
- width: delegate.width
- font.pixelSize: 12
- textFormat: Text.RichText
- font.italic: true
- text: timeSinceEvent(pubDate) + " (<a href=\"" + link + "\">Link</a>)"
- onLinkActivated: {
- Qt.openUrlExternally(link)
- }
- }
-
- Text {
- id: descriptionText
-
- text: description
- width: parent.width
- wrapMode: Text.WordWrap
- font.pixelSize: 14
- textFormat: Text.StyledText
- horizontalAlignment: Qt.AlignLeft
- }
-}
diff --git a/examples/quick/demos/rssnews/content/RssFeeds.qml b/examples/quick/demos/rssnews/content/RssFeeds.qml
deleted file mode 100644
index 46a6c875c8..0000000000
--- a/examples/quick/demos/rssnews/content/RssFeeds.qml
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-
-ListModel {
- ListElement { name: "Top Stories"; feed: "news.yahoo.com/rss/topstories"; image: "images/TopStories.jpg" }
- ListElement { name: "World"; feed: "news.yahoo.com/rss/world"; image: "images/World.jpg" }
- ListElement { name: "Europe"; feed: "news.yahoo.com/rss/europe"; image: "images/Europe.jpg" }
- ListElement { name: "Asia"; feed: "news.yahoo.com/rss/asia"; image: "images/Asia.jpg" }
- ListElement { name: "U.S. National"; feed: "news.yahoo.com/rss/us"; image: "images/USNational.jpg" }
- ListElement { name: "Politics"; feed: "news.yahoo.com/rss/politics"; image: "images/Politics.jpg" }
- ListElement { name: "Business"; feed: "news.yahoo.com/rss/business"; image: "images/Business.jpg" }
- ListElement { name: "Technology"; feed: "news.yahoo.com/rss/tech"; image: "images/Technology.jpg" }
- ListElement { name: "Entertainment"; feed: "news.yahoo.com/rss/entertainment"; image: "images/Entertainment.jpg" }
- ListElement { name: "Health"; feed: "news.yahoo.com/rss/health"; image: "images/Health.jpg" }
- ListElement { name: "Science"; feed: "news.yahoo.com/rss/science"; image: "images/Science.jpg" }
- ListElement { name: "Sports"; feed: "news.yahoo.com/rss/sports"; image: "images/Sports.jpg" }
-}
diff --git a/examples/quick/demos/rssnews/content/ScrollBar.qml b/examples/quick/demos/rssnews/content/ScrollBar.qml
deleted file mode 100644
index bd774188c8..0000000000
--- a/examples/quick/demos/rssnews/content/ScrollBar.qml
+++ /dev/null
@@ -1,126 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-
-Item {
- id: container
-
- property variant scrollArea
- property int 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()
- y: container.orientation == Qt.Vertical ? position() : 2
- width: container.orientation == Qt.Vertical ? container.width - 4 : size()
- 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/quick/demos/rssnews/content/images/Asia.jpg b/examples/quick/demos/rssnews/content/images/Asia.jpg
deleted file mode 100644
index a609557a08..0000000000
--- a/examples/quick/demos/rssnews/content/images/Asia.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Business.jpg b/examples/quick/demos/rssnews/content/images/Business.jpg
deleted file mode 100644
index b2c1d92138..0000000000
--- a/examples/quick/demos/rssnews/content/images/Business.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Entertainment.jpg b/examples/quick/demos/rssnews/content/images/Entertainment.jpg
deleted file mode 100644
index 2c69fc04d7..0000000000
--- a/examples/quick/demos/rssnews/content/images/Entertainment.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Europe.jpg b/examples/quick/demos/rssnews/content/images/Europe.jpg
deleted file mode 100644
index bf524e13d0..0000000000
--- a/examples/quick/demos/rssnews/content/images/Europe.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Health.jpg b/examples/quick/demos/rssnews/content/images/Health.jpg
deleted file mode 100644
index 0e8c71f0c9..0000000000
--- a/examples/quick/demos/rssnews/content/images/Health.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Politics.jpg b/examples/quick/demos/rssnews/content/images/Politics.jpg
deleted file mode 100644
index 0b1800c97e..0000000000
--- a/examples/quick/demos/rssnews/content/images/Politics.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Science.jpg b/examples/quick/demos/rssnews/content/images/Science.jpg
deleted file mode 100644
index 7faccbbb97..0000000000
--- a/examples/quick/demos/rssnews/content/images/Science.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Sports.jpg b/examples/quick/demos/rssnews/content/images/Sports.jpg
deleted file mode 100644
index 0ab3bd3ce7..0000000000
--- a/examples/quick/demos/rssnews/content/images/Sports.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/Technology.jpg b/examples/quick/demos/rssnews/content/images/Technology.jpg
deleted file mode 100644
index db553028fb..0000000000
--- a/examples/quick/demos/rssnews/content/images/Technology.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/TopStories.jpg b/examples/quick/demos/rssnews/content/images/TopStories.jpg
deleted file mode 100644
index e35bd67f20..0000000000
--- a/examples/quick/demos/rssnews/content/images/TopStories.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/USNational.jpg b/examples/quick/demos/rssnews/content/images/USNational.jpg
deleted file mode 100644
index 82c78228c1..0000000000
--- a/examples/quick/demos/rssnews/content/images/USNational.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/World.jpg b/examples/quick/demos/rssnews/content/images/World.jpg
deleted file mode 100644
index 7a0a806fd4..0000000000
--- a/examples/quick/demos/rssnews/content/images/World.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/btn_close.png b/examples/quick/demos/rssnews/content/images/btn_close.png
deleted file mode 100644
index 1a3dc44380..0000000000
--- a/examples/quick/demos/rssnews/content/images/btn_close.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/busy.png b/examples/quick/demos/rssnews/content/images/busy.png
deleted file mode 100644
index fc65122d26..0000000000
--- a/examples/quick/demos/rssnews/content/images/busy.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/content/images/scrollbar.png b/examples/quick/demos/rssnews/content/images/scrollbar.png
deleted file mode 100644
index c2425dd0df..0000000000
--- a/examples/quick/demos/rssnews/content/images/scrollbar.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png b/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png
deleted file mode 100644
index 9d324ceb70..0000000000
--- a/examples/quick/demos/rssnews/doc/images/qtquick-demo-rssnews-small.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/rssnews/doc/src/rssnews.qdoc b/examples/quick/demos/rssnews/doc/src/rssnews.qdoc
deleted file mode 100644
index 4ba874cd70..0000000000
--- a/examples/quick/demos/rssnews/doc/src/rssnews.qdoc
+++ /dev/null
@@ -1,372 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - RSS News
- \ingroup qtquickdemos
- \example demos/rssnews
- \brief A QML RSS news reader that uses XmlListModel and XmlRole to download
- XML data, ListModel and ListElement to create a category list, and ListView
- to display the data.
-
- \image qtquick-demo-rssnews-small.png
-
- \e{RSS News} demonstrates the following \l{Qt Quick} features:
-
- \list
- \li Using custom types to create screens and screen controls.
- \li Using list models and list elements to represent data.
- \li Using XML list models to download XML data.
- \li Using list views to display data.
- \li Using the \l Component type to create a footer for the news item
- list view.
- \li Using the \l Image type to create a button for closing the app.
- \endlist
-
- \include examples-run.qdocinc
-
- \section1 Using Custom Types
-
- In the RSS News app, we use the following custom types that are each defined
- in a separate .qml file:
-
- \list
- \li \c BusyIndicator.qml
- \li \c CategoryDelegate.qml
- \li \c NewsDelegate.qml
- \li \c RssFeeds.qml
- \li \c ScrollBar.qml
- \endlist
-
- To use the custom types, we add an import statement to the main QML file,
- rssnews.qml that imports the folder called \c content where the types are
- located:
-
- \quotefromfile demos/rssnews/rssnews.qml
- \skipto content
- \printuntil "
-
- \section1 Creating the Main Window
-
- In rssnews.qml, we use a \l{Rectangle} type with custom properties to create
- the app main window:
-
- \printuntil isPortrait
-
- We will use the custom properties later for loading XML data and for
- adjusting the screen layout depending on its orientation.
-
- \section1 Creating a Category List
-
- In rssnews.qml, we use the RssFeeds custom type that we specify in
- RssFeeds.qml to create a list of feed categories:
-
- \skipto RssFeeds
- \printuntil }
-
- In RssFeeds.qml, we use a ListModel type with a ListElement type to
- create a category list where list elements represent feed categories:
-
- \quotefromfile demos/rssnews/content/RssFeeds.qml
- \skipto ListModel
- \printuntil /^\}/
-
- List elements are defined like other QML types except that they contain a
- collection of \e role definitions instead of properties. Roles both define
- how the data is accessed and include the data itself.
-
- For each list element, we use the \c name role to specify the category name,
- the \c feed role to specify the URL to load the data from, and the \c image
- role to display an image for the category.
-
- In rssnews.qml, we use a ListView type to display the category list:
-
- \quotefromfile demos/rssnews/rssnews.qml
- \skipto ListView
- \printuntil }
- \printuntil }
-
- To lay out the category list horizontally at the top of the window in
- portrait orientation and vertically on the left side in landscape
- orientation, we use the \c orientation property. Based on the orientation,
- we bind either the width or the height of the list to a fixed value
- (\c itemWidth).
-
- We use the \c anchors.top property to position the list view at the top of
- the screen in both orientations.
-
- We use the \c model property to load XML data from the \c rssFeeds model,
- and \c CategoryDelegate as the delegate to instantiate each item in the
- list.
-
- \section1 Creating List Elements
-
- In CategoryDelegate.qml, we use the \l Rectangle type with custom properties
- to create list elements:
-
- \quotefromfile demos/rssnews/content/CategoryDelegate.qml
- \skipto Rectangle
- \printuntil selected
-
- We set the \c selected property to the \c ListView.isCurrentItem attached
- property to specify that \c selected is \c true if \c delegate is the
- current item.
-
- We use the \l Image type \c source property to display the image, centered
- in the delegate, specified for the list element by the \c image role in the
- \c rssFeeds list model:
-
- \skipto Image
- \printuntil }
-
- We use a \l Text type to add titles to list elements:
-
- \printuntil Behavior
- \printuntil }
-
- We use the \c anchors property to position the title at the top of the list
- element, with a 20-pixel margin. We use \c font properties to adjust font
- size and text formatting.
-
- We use the \c color property to brighten the text and to scale it slightly
- larger when the list item is the current item. By applying a \l Behavior to
- the property, we animate the actions of selecting and deselecting list
- items.
-
- We use a MouseArea type to download XML data when users tap a category list
- element:
-
- \skipto MouseArea
- \printuntil }
- \printuntil }
-
- The \c anchors.fill property is set to \c delegate to enable users to tap
- anywhere within the list element.
-
- We use the \c onClicked signal handler to load the XML data for the category
- list. If the tapped category is already current, the \c reload() function
- is called to reload the data.
-
- \section1 Downloading XML Data
-
- In rssnews.qml, we use an XmlListModel type as a data source for ListView
- elements to display news items in the selected category:
-
- \quotefromfile demos/rssnews/rssnews.qml
- \skipto XmlListModel {
- \printuntil namespaceDeclarations
-
- We use the \c source property and the \c window.currentFeed custom property
- to fetch news items for the selected category.
-
- The \c query property specifies that the XmlListModel generates a model item
- for each \c <item> in the XML document.
-
- We use the XmlRole type to specify the model item attributes. Each model
- item has the \c title, \c description, \c image, \c link, and \c pubDate
- attributes that match the values of the corresponding \c <item> in the XML
- document:
-
- \printuntil pubDate
- \printuntil }
-
- We use the \c feedModel model in a ListView type to display the data:
-
- \skipuntil ScrollBar
- \skipto ListView
- \printuntil }
- \printuntil }
-
- To list the news items below the category list in portrait orientation and
- to its right in landscape orientation, we use the \c isPortrait custom
- property to anchor the top of the news items list to the left of \c window
- and bottom of \c categories in portrait orientation and to the right of
- \c categories and bottom of \c window in landscape orientation.
-
- We use the \c anchors.bottom property to anchor the bottom of the list view
- to the bottom of the window in both orientations.
-
- In portrait orientation, we clip the painting of the news items to the
- bounding rectangle of the list view to avoid graphical artifacts when news
- items are scrolled over other items. In landscape, this is not required,
- because the list spans the entire screen vertically.
-
- We use the \c model property to load XML data from the \c feedModel model,
- and use \c NewsDelegate as the delegate to instantiate each item in the
- list.
-
- In NewsDelegate.qml, we use a \l Column type to lay out the XML data:
-
- \quotefromfile demos/rssnews/content/NewsDelegate.qml
- \skipto Column
- \printuntil spacing
-
- Within the column, we use a \l Row and another column to position images and
- title text:
-
- \skipto Row
- \printuntil font.bold
- \printuntil }
- \printuntil }
-
- We generate a textual representation of how long ago the item was posted
- using the \c timeSinceEvent() JavaScript function:
-
- \printuntil }
- \printuntil }
-
- We use the \c onLinkActivated signal handler to open the URL in an external
- browser when users select the link.
-
- \section1 Providing Feedback to Users
-
- In CategoryDelegate.qml, we use the \c BusyIndicator custom type to indicate
- activity while the XML data is being loaded:
-
- \quotefromfile demos/rssnews/content/CategoryDelegate.qml
- \skipto BusyIndicator
- \printuntil }
-
- We use the \c scale property to reduce the indicator size to \c 0.8. We bind
- the \c visible property to the \c isCurrentItem attached property of the
- \c delegate list view and \c loading property of the main window to display
- the indicator image when a category list item is the current item and XML
- data is being loaded.
-
- We define the \c BusyIndicator type in \c BusyIndicator.qml. We use an
- \l Image type to display an image and apply a NumberAnimation to its
- \c rotation property to rotate the image in an infinite loop:
-
- \quotefromfile demos/rssnews/content/BusyIndicator.qml
- \skipto Image
- \printuntil }
- \printuntil }
-
- In your apps, you can also use the BusyIndicator type from the
- \l {Qt Quick Controls} module.
-
- \section1 Creating Scroll Bars
-
- In rssnews.qml, we use our own custom \c ScrollBar type to create scroll
- bars in the category and news item list views. In your apps, you can also
- use the ScrollView type from the \l {Qt Quick Controls} module.
-
- First, we create a scroll bar in the category list view. We bind the
- \c orientation property to the \c isPortrait property and to the
- \c Horizontal value of the \c Qt::Orientation enum type to display a
- horizontal scroll bar in portrait orientation and to the \c Vertical value
- to display a vertical scroll bar in landscape orientation:
-
- \quotefromfile demos/rssnews/rssnews.qml
- \skipto ScrollBar
- \printuntil }
-
- Same as with the \c categories list view, we adjust the width and height of
- the scroll bar based on the \c isPortrait property.
-
- We use the \c scrollArea property to display the scroll bar in the
- \c categories list view.
-
- We use the \c anchors.right property to anchor the scroll bar to the right
- side of the category list.
-
- \skipto ScrollBar
- \printuntil }
-
- Second, we create another scroll bar in the news item list view. We want a
- vertical scroll bar to appear on the right side of the view regardless of
- screen orientation, so we can set the \c width property to \c 8 and bind the
- \c anchors.right property to the \c window.right property. We use the
- \c anchors.top property to anchor the scroll bar top to the bottom of the
- category list in portrait orientation and to the top of the news item list
- in landscape orientation. We use the \c anchors.bottom property to anchor
- the scroll bar bottom to the list view bottom in both orientations.
-
- We define the \c ScrollBar type in \c ScrollBar.qml. We use an \l Item type
- with custom properties to create a container for the scroll bar:
-
- \quotefromfile demos/rssnews/content/ScrollBar.qml
- \skipto Item
- \printuntil opacity
-
- We use a BorderImage type to display the scroll bar thumb at the x and y
- position that we calculate by using the \c position() function:
-
- \skipto BorderImage
- \printuntil height
- \printuntil }
-
- We use the \c size function to calculate the thumb width and height
- depending on the screen orientation.
-
- We use \c states to make the scroll bar visible when the users move the
- scroll area:
-
- \printuntil }
- \printuntil }
-
- We use \c transitions to apply a NumberAnimation to the \c "opacity"
- property when the state changes from "visible" to the default state:
-
- \printuntil /^\}/
-
- \section1 Creating Footers
-
- In rssnews.qml, we use a \l Component type with a \l Rectangle type to
- create a footer for the news list view:
-
- \quotefromfile demos/rssnews/rssnews.qml
- \skipto Component
- \printuntil }
- \printuntil }
- \printuntil }
-
- We bind the \c width of the footer to the width of the component and the
- \c height to the of close button to align them when no news items are
- displayed.
-
- \section1 Creating Buttons
-
- In rssnews.qml, we use an \l Image type to create a simple push button that
- users can tap to close the app:
-
- \printuntil Qt.quit()
- \printuntil }
- \printuntil }
- \printuntil }
-
- We use \c anchors to position the close button in the top right corner of
- the news list view, with 4-pixel margins. Because the close button overlaps
- the category list in portrait orientation, we animate the \c opacity
- property to make the button almost fully transparent when users are
- scrolling the category list.
-
- We use the \c onClicked signal handler within a MouseArea to call the
- \c quit() function when users select the close button.
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/rssnews/main.cpp b/examples/quick/demos/rssnews/main.cpp
deleted file mode 100644
index a0d621bbb6..0000000000
--- a/examples/quick/demos/rssnews/main.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/rssnews/rssnews)
diff --git a/examples/quick/demos/rssnews/rssnews.pro b/examples/quick/demos/rssnews/rssnews.pro
deleted file mode 100644
index c67c5a6558..0000000000
--- a/examples/quick/demos/rssnews/rssnews.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-
-QT += quick qml xml xmlpatterns
-SOURCES += main.cpp
-RESOURCES += rssnews.qrc
-
-OTHER_FILES = rssnews.qml \
- content/*.qml \
- content/*.js \
- content/images/*
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/rssnews
-INSTALLS += target
diff --git a/examples/quick/demos/rssnews/rssnews.qml b/examples/quick/demos/rssnews/rssnews.qml
deleted file mode 100644
index 263154f956..0000000000
--- a/examples/quick/demos/rssnews/rssnews.qml
+++ /dev/null
@@ -1,169 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.2
-import QtQuick.XmlListModel 2.0
-import QtQuick.Window 2.1
-import "./content"
-
-Rectangle {
- id: window
-
- width: 800
- height: 480
-
- property string currentFeed: rssFeeds.get(0).feed
- property bool loading: feedModel.status === XmlListModel.Loading
- property bool isPortrait: Screen.primaryOrientation === Qt.PortraitOrientation
-
- onLoadingChanged: {
- if (feedModel.status == XmlListModel.Ready)
- list.positionViewAtBeginning()
- }
-
- RssFeeds { id: rssFeeds }
-
- XmlListModel {
- id: feedModel
-
- source: "http://" + window.currentFeed
- query: "/rss/channel/item[child::media:content]"
- namespaceDeclarations: "declare namespace media = 'http://search.yahoo.com/mrss/';"
-
- XmlRole { name: "title"; query: "title/string()" }
- // Remove any links from the description
- XmlRole { name: "description"; query: "fn:replace(description/string(), '\&lt;a href=.*\/a\&gt;', '')" }
- XmlRole { name: "image"; query: "media:content/@url/string()" }
- XmlRole { name: "link"; query: "link/string()" }
- XmlRole { name: "pubDate"; query: "pubDate/string()" }
- }
-
- ListView {
- id: categories
- property int itemWidth: 190
-
- width: isPortrait ? parent.width : itemWidth
- height: isPortrait ? itemWidth : parent.height
- orientation: isPortrait ? ListView.Horizontal : ListView.Vertical
- anchors.top: parent.top
- model: rssFeeds
- delegate: CategoryDelegate { itemSize: categories.itemWidth }
- spacing: 3
- }
-
- ScrollBar {
- id: listScrollBar
-
- orientation: isPortrait ? Qt.Horizontal : Qt.Vertical
- height: isPortrait ? 8 : categories.height;
- width: isPortrait ? categories.width : 8
- scrollArea: categories;
- anchors.right: categories.right
- }
-
- ListView {
- id: list
-
- anchors.left: isPortrait ? window.left : categories.right
- anchors.right: closeButton.left
- anchors.top: isPortrait ? categories.bottom : window.top
- anchors.bottom: window.bottom
- anchors.leftMargin: 30
- anchors.rightMargin: 4
- clip: isPortrait
- model: feedModel
- footer: footerText
- delegate: NewsDelegate {}
- }
-
- ScrollBar {
- scrollArea: list
- width: 8
- anchors.right: window.right
- anchors.top: isPortrait ? categories.bottom : window.top
- anchors.bottom: window.bottom
- }
-
- Component {
- id: footerText
-
- Rectangle {
- width: parent.width
- height: closeButton.height
- color: "lightgray"
-
- Text {
- text: "RSS Feed from Yahoo News"
- anchors.centerIn: parent
- font.pixelSize: 14
- }
- }
- }
-
- Image {
- id: closeButton
- source: "content/images/btn_close.png"
- scale: 0.8
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.margins: 4
- opacity: (isPortrait && categories.moving) ? 0.2 : 1.0
- Behavior on opacity {
- NumberAnimation { duration: 300; easing.type: Easing.OutSine }
- }
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- Qt.quit()
- }
- }
- }
-}
diff --git a/examples/quick/demos/rssnews/rssnews.qmlproject b/examples/quick/demos/rssnews/rssnews.qmlproject
deleted file mode 100644
index 5becbdaed0..0000000000
--- a/examples/quick/demos/rssnews/rssnews.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-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/quick/demos/rssnews/rssnews.qrc b/examples/quick/demos/rssnews/rssnews.qrc
deleted file mode 100644
index 1208d44fd7..0000000000
--- a/examples/quick/demos/rssnews/rssnews.qrc
+++ /dev/null
@@ -1,25 +0,0 @@
-<RCC>
- <qresource prefix="/demos/rssnews">
- <file>rssnews.qml</file>
- <file>content/BusyIndicator.qml</file>
- <file>content/CategoryDelegate.qml</file>
- <file>content/NewsDelegate.qml</file>
- <file>content/RssFeeds.qml</file>
- <file>content/ScrollBar.qml</file>
- <file>content/images/btn_close.png</file>
- <file>content/images/Business.jpg</file>
- <file>content/images/busy.png</file>
- <file>content/images/Entertainment.jpg</file>
- <file>content/images/Europe.jpg</file>
- <file>content/images/Health.jpg</file>
- <file>content/images/Asia.jpg</file>
- <file>content/images/Politics.jpg</file>
- <file>content/images/Science.jpg</file>
- <file>content/images/scrollbar.png</file>
- <file>content/images/Sports.jpg</file>
- <file>content/images/Technology.jpg</file>
- <file>content/images/TopStories.jpg</file>
- <file>content/images/USNational.jpg</file>
- <file>content/images/World.jpg</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/samegame/content/Block.qml b/examples/quick/demos/samegame/content/Block.qml
deleted file mode 100644
index 5c6e584e37..0000000000
--- a/examples/quick/demos/samegame/content/Block.qml
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 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){
- "gfx/red.png";
- } else if (type == 1) {
- "gfx/blue.png";
- } else if (type == 2) {
- "gfx/green.png";
- } else {
- "gfx/yellow.png";
- }
- }
- opacity: 0
- Behavior on opacity { NumberAnimation { duration: 200 } }
- anchors.fill: parent
- }
-
- //Foreground particles
- BlockEmitter {
- id: particles
- system: particleSystem
- group: {
- if (type == 0){
- "red";
- } else if (type == 1) {
- "blue";
- } else if (type == 2) {
- "green";
- } else {
- "yellow";
- }
- }
- anchors.fill: parent
- }
-
- //Paint particles on the background
- PaintEmitter {
- id: particles2
- system: particleSystem
- }
-
- 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); particles2.pulse(100);} }
- PropertyChanges { target: img; opacity: 0 }
- StateChangeScript { script: block.destroy(1000); }
- }
- ]
-}
diff --git a/examples/quick/demos/samegame/content/BlockEmitter.qml b/examples/quick/demos/samegame/content/BlockEmitter.qml
deleted file mode 100644
index cbcc5df99f..0000000000
--- a/examples/quick/demos/samegame/content/BlockEmitter.qml
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-// Needed for singletons QTBUG-34418
-import "."
-
-Emitter {
- property Item block: parent
- velocity: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -40; magnitudeVariation: 40}
- acceleration: TargetDirection{targetX: block.width/2; targetY: block.height/2; magnitude: -100;}
- shape: EllipseShape{fill:true}
- enabled: false;
- lifeSpan: 700; lifeSpanVariation: 100
- emitRate: 1000
- maximumEmitted: 100 //only fires 0.1s bursts (still 2x old number)
- size: Settings.blockSize * 0.85
- endSize: Settings.blockSize * 0.85 /2
-}
diff --git a/examples/quick/demos/samegame/content/Button.qml b/examples/quick/demos/samegame/content/Button.qml
deleted file mode 100644
index baaa7c73b0..0000000000
--- a/examples/quick/demos/samegame/content/Button.qml
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-
-Item {
- property alias imgSrc: image.source
- property alias system: emitter.system
- property alias group: emitter.group
- signal clicked
- property bool rotatedButton: false
-
- width: image.width
- height: image.sourceSize.height
- Image {
- id: image
- height: parent.height
- width: height/sourceSize.height * sourceSize.width
-
- anchors.horizontalCenter: parent.horizontalCenter
- rotation: rotatedButton ? ((Math.random() * 3 + 2) * (Math.random() <= 0.5 ? -1 : 1)) : 0
- MenuEmitter {
- id: emitter
- anchors.fill: parent
- //shape: MaskShape {source: image.source}
- }
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {parent.clicked(); emitter.burst(400);}
- }
-}
diff --git a/examples/quick/demos/samegame/content/GameArea.qml b/examples/quick/demos/samegame/content/GameArea.qml
deleted file mode 100644
index 0f51fcf002..0000000000
--- a/examples/quick/demos/samegame/content/GameArea.qml
+++ /dev/null
@@ -1,238 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-import "samegame.js" as Logic
-import "."
-
-Item {
- id: gameCanvas
- property bool gameOver: true
- property int score: 0
- property int highScore: 0
- property int moves: 0
- property string mode: ""
- property ParticleSystem ps: particleSystem
- //For easy theming
- property alias backgroundVisible: bg.visible
- property string background: "gfx/background.png"
- property string blockFile: "Block.qml"
- property int blockSize: Settings.blockSize
- onBlockFileChanged: Logic.changeBlock(blockFile);
- property alias particlePack: auxLoader.source
- //For multiplayer
- property int score2: 0
- property int curTurn: 1
- property bool autoTurnChange: false
- signal swapPlayers
- property bool swapping: false
- //onSwapPlayers: if (autoTurnChange) Logic.turnChange();//Now implemented below
- //For puzzle
- property url level
- property bool puzzleWon: false
- signal puzzleLost //Since root is tracking the puzzle progress
- function showPuzzleEnd (won) {
- if (won) {
- smokeParticle.color = Qt.rgba(0,1,0,0);
- puzzleWin.play();
- } else {
- smokeParticle.color = Qt.rgba(1,0,0,0);
- puzzleFail.play();
- puzzleLost();
- }
- }
- function showPuzzleGoal (str) {
- puzzleTextBubble.opacity = 1;
- puzzleTextLabel.text = str;
- }
- Image {
- id: bg
- z: -1
- anchors.fill: parent
- source: background;
- fillMode: Image.PreserveAspectCrop
- }
-
- MouseArea {
- anchors.fill: parent; onClicked: {
- if (puzzleTextBubble.opacity == 1) {
- puzzleTextBubble.opacity = 0;
- Logic.finishLoadingMap();
- } else if (!swapping) {
- Logic.handleClick(mouse.x,mouse.y);
- }
- }
- }
-
- Image {
- id: highScoreTextBubble
- opacity: mode == "arcade" && gameOver && gameCanvas.score == gameCanvas.highScore ? 1 : 0
- Behavior on opacity { NumberAnimation {} }
- anchors.centerIn: parent
- z: 10
- source: "gfx/bubble-highscore.png"
- Image {
- anchors.centerIn: parent
- source: "gfx/text-highscore-new.png"
- rotation: -10
- }
- }
-
- Image {
- id: puzzleTextBubble
- anchors.centerIn: parent
- opacity: 0
- Behavior on opacity { NumberAnimation {} }
- z: 10
- source: "gfx/bubble-puzzle.png"
- Connections {
- target: gameCanvas
- onModeChanged: if (mode != "puzzle" && puzzleTextBubble.opacity > 0) puzzleTextBubble.opacity = 0;
- }
- Text {
- id: puzzleTextLabel
- width: parent.width - 24
- anchors.centerIn: parent
- horizontalAlignment: Text.AlignHCenter
- color: "white"
- font.pixelSize: 24
- font.bold: true
- wrapMode: Text.WordWrap
- }
- }
- onModeChanged: {
- p1WonImg.opacity = 0;
- p2WonImg.opacity = 0;
- }
- SmokeText { id: puzzleWin; source: "gfx/icon-ok.png"; system: particleSystem }
- SmokeText { id: puzzleFail; source: "gfx/icon-fail.png"; system: particleSystem }
-
- onSwapPlayers: {
- smokeParticle.color = "yellow"
- Logic.turnChange();
- if (curTurn == 1) {
- p1Text.play();
- } else {
- p2Text.play();
- }
- clickDelay.running = true;
- }
- SequentialAnimation {
- id: clickDelay
- ScriptAction { script: gameCanvas.swapping = true; }
- PauseAnimation { duration: 750 }
- ScriptAction { script: gameCanvas.swapping = false; }
- }
-
- SmokeText {
- id: p1Text; source: "gfx/text-p1-go.png";
- system: particleSystem; playerNum: 1
- opacity: p1WonImg.opacity + p2WonImg.opacity > 0 ? 0 : 1
- }
-
- SmokeText {
- id: p2Text; source: "gfx/text-p2-go.png";
- system: particleSystem; playerNum: 2
- opacity: p1WonImg.opacity + p2WonImg.opacity > 0 ? 0 : 1
- }
-
- onGameOverChanged: {
- if (gameCanvas.mode == "multiplayer") {
- if (gameCanvas.score >= gameCanvas.score2) {
- p1WonImg.opacity = 1;
- } else {
- p2WonImg.opacity = 1;
- }
- }
- }
- Image {
- id: p1WonImg
- source: "gfx/text-p1-won.png"
- anchors.centerIn: parent
- opacity: 0
- Behavior on opacity { NumberAnimation {} }
- z: 10
- }
- Image {
- id: p2WonImg
- source: "gfx/text-p2-won.png"
- anchors.centerIn: parent
- opacity: 0
- Behavior on opacity { NumberAnimation {} }
- z: 10
- }
-
- ParticleSystem{
- id: particleSystem;
- anchors.fill: parent
- z: 5
- ImageParticle {
- id: smokeParticle
- groups: ["smoke"]
- source: "gfx/particle-smoke.png"
- alpha: 0.1
- alphaVariation: 0.1
- color: "yellow"
- }
- Loader {
- id: auxLoader
- anchors.fill: parent
- source: "PrimaryPack.qml"
- onItemChanged: {
- if (item && "particleSystem" in item)
- item.particleSystem = particleSystem
- if (item && "gameArea" in item)
- item.gameArea = gameCanvas
- }
- }
- }
-}
-
diff --git a/examples/quick/demos/samegame/content/LogoAnimation.qml b/examples/quick/demos/samegame/content/LogoAnimation.qml
deleted file mode 100644
index fd89ea8167..0000000000
--- a/examples/quick/demos/samegame/content/LogoAnimation.qml
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-
-Item {
- id: container //Positioned where the 48x48 S/G should be
- property alias running: mainAnim.running
- property ParticleSystem particleSystem
- property int dur: 500
- signal boomTime
- Image {
- id: s1
- source: "gfx/logo-s.png"
- y: 0
- }
- Image {
- id: g1
- source: "gfx/logo-g.png"
- y: -128
- }
- Column {
- Repeater {
- model: 2
- Item {
- width: 48
- height: 48
- BlockEmitter {
- id: emitter
- anchors.fill: parent
- group: "red"
- system: particleSystem
- Connections {
- target: container
- onBoomTime: emitter.pulse(100);
- }
- }
- }
- }
- }
- SequentialAnimation {
- id: mainAnim
- running: true
- loops: -1
- PropertyAction { target: g1; property: "y"; value: -128}
- PropertyAction { target: g1; property: "opacity"; value: 1}
- PropertyAction { target: s1; property: "y"; value: 0}
- PropertyAction { target: s1; property: "opacity"; value: 1}
- NumberAnimation { target: g1; property: "y"; from: -96; to: -48; duration: dur}
- ParallelAnimation {
- NumberAnimation { target: g1; property: "y"; from: -48; to: 0; duration: dur}
- NumberAnimation { target: s1; property: "y"; from: 0; to: 48; duration: dur }
- }
- PauseAnimation { duration: dur }
- ScriptAction { script: container.boomTime(); }
- ParallelAnimation {
- NumberAnimation { target: g1; property: "opacity"; to: 0; duration: dur }
- NumberAnimation { target: s1; property: "opacity"; to: 0; duration: dur }
- }
- PropertyAction { target: s1; property: "y"; value: -128}
- PropertyAction { target: s1; property: "opacity"; value: 1}
- NumberAnimation { target: s1; property: "y"; from: -96; to: 0; duration: dur * 2}
- }
-}
diff --git a/examples/quick/demos/samegame/content/MenuEmitter.qml b/examples/quick/demos/samegame/content/MenuEmitter.qml
deleted file mode 100644
index 20cbb2c1a6..0000000000
--- a/examples/quick/demos/samegame/content/MenuEmitter.qml
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-
-Emitter {
- anchors.fill: parent
- velocity: AngleDirection{angleVariation: 360; magnitude: 140; magnitudeVariation: 40}
- enabled: false;
- lifeSpan: 500;
- emitRate: 1
- size: 28
- endSize: 14
- group: "yellow"
-}
diff --git a/examples/quick/demos/samegame/content/PaintEmitter.qml b/examples/quick/demos/samegame/content/PaintEmitter.qml
deleted file mode 100644
index dd67c966a2..0000000000
--- a/examples/quick/demos/samegame/content/PaintEmitter.qml
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-import "."
-
-Emitter {
- property Item block: parent
- anchors.fill: parent
- shape: EllipseShape { fill: true }
- group: {
- if (block.type == 0){
- "redspots";
- } else if (block.type == 1) {
- "bluespots";
- } else if (block.type == 2) {
- "greenspots";
- } else {
- "yellowspots";
- }
- }
- size: Settings.blockSize * 2
- endSize: Settings.blockSize/2
- lifeSpan: 30000
- enabled: false
- emitRate: 60
- maximumEmitted: 60
- velocity: PointDirection{ y: 4; yVariation: 4 }
- /* Possibly better, but dependent on gerrit change,28212
- property real mainIntensity: 0.8
- property real subIntensity: 0.1
- property real colorVariation: 0.005
- onEmitParticles: {//One group, many colors, for better stacking
- for (var i=0; i<particles.length; i++) {
- var particle = particles[i];
- if (block.type == 0) {
- particle.red = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.green = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.blue = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- } else if (block.type == 1) {
- particle.red = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.green = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.blue = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- } else if (block.type == 2) {
- particle.red = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.green = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.blue = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- } else if (block.type == 3) {
- particle.red = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.green = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.blue = subIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- } else {
- particle.red = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.green = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- particle.blue = mainIntensity + (Math.random() * colorVariation * 2 - colorVariation);
- }
- }
- }
- */
-}
diff --git a/examples/quick/demos/samegame/content/PrimaryPack.qml b/examples/quick/demos/samegame/content/PrimaryPack.qml
deleted file mode 100644
index 0e3b77087c..0000000000
--- a/examples/quick/demos/samegame/content/PrimaryPack.qml
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-
-Item {
- id: container
- property ParticleSystem particleSystem
- property GameArea gameArea
- onGameAreaChanged: bgstacker.parent = gameArea;//Move to direct child of game canvas
- Item {
- id: bgstacker
- z: 0
- ImageParticle {
- groups: ["yellowspots"]
- color: Qt.darker("yellow");//Actually want desaturated...
- system: particleSystem
- source: "gfx/particle-paint.png"
- colorVariation: 0.2
- alpha: 0.2
- entryEffect: ImageParticle.None
- }
- ImageParticle {
- groups: ["redspots"]
- system: particleSystem
- color: Qt.darker("red");//Actually want desaturated...
- source: "gfx/particle-paint.png"
- colorVariation: 0.2
- alpha: 0.2
- entryEffect: ImageParticle.None
- }
- ImageParticle {
- groups: ["greenspots"]
- system: particleSystem
- color: Qt.darker("green");//Actually want desaturated...
- source: "gfx/particle-paint.png"
- colorVariation: 0.2
- alpha: 0.2
- entryEffect: ImageParticle.None
- }
- ImageParticle {
- groups: ["bluespots"]
- system: particleSystem
- color: Qt.darker("blue");//Actually want desaturated...
- source: "gfx/particle-paint.png"
- colorVariation: 0.2
- alpha: 0.2
- entryEffect: ImageParticle.None
- }
- }
- ImageParticle {
- groups: ["yellow"]
- system: particleSystem
- color: Qt.darker("yellow");//Actually want desaturated...
- source: "gfx/particle-brick.png"
- colorVariation: 0.4
- alpha: 0.1
- }
- ImageParticle {
- groups: ["red"]
- system: particleSystem
- color: Qt.darker("red");//Actually want desaturated...
- source: "gfx/particle-brick.png"
- colorVariation: 0.4
- alpha: 0.1
- }
- ImageParticle {
- groups: ["green"]
- system: particleSystem
- color: Qt.darker("green");//Actually want desaturated...
- source: "gfx/particle-brick.png"
- colorVariation: 0.4
- alpha: 0.1
- }
- ImageParticle {
- groups: ["blue"]
- system: particleSystem
- color: Qt.darker("blue");//Actually want desaturated...
- source: "gfx/particle-brick.png"
- colorVariation: 0.4
- alpha: 0.1
- }
-}
diff --git a/examples/quick/demos/samegame/content/PuzzleBlock.qml b/examples/quick/demos/samegame/content/PuzzleBlock.qml
deleted file mode 100644
index f65b79d516..0000000000
--- a/examples/quick/demos/samegame/content/PuzzleBlock.qml
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 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;
- NumberAnimation{ easing.type: Easing.OutBounce }
- }
- Behavior on y {
- NumberAnimation{ easing.type: Easing.InQuad }
- }
-
- Image {
- id: img
- source: {
- if (type == 0){
- "gfx/red-puzzle.png";
- } else if (type == 1) {
- "gfx/blue-puzzle.png";
- } else if (type == 2) {
- "gfx/green-puzzle.png";
- } else {
- "gfx/yellow-puzzle.png";
- }
- }
- opacity: 0
- Behavior on opacity { NumberAnimation { duration: 200 } }
- anchors.centerIn: parent
- anchors.verticalCenterOffset: -4
- anchors.horizontalCenterOffset: 4
- }
-
- //Foreground particles
- BlockEmitter {
- id: particles
- system: particleSystem
- group: {
- if (type == 0){
- "red";
- } else if (type == 1) {
- "blue";
- } else if (type == 2) {
- "green";
- } else {
- "yellow";
- }
- }
- anchors.fill: parent
- }
-
- states: [
- State {
- name: "AliveState"; when: spawned == true && dying == false
- PropertyChanges { target: img; opacity: 1 }
- },
-
- State {
- name: "DeathState"; when: dying == true
- PropertyChanges { target: img; scale: 2 }
- StateChangeScript { script: particles.pulse(200); }
- PropertyChanges { target: img; opacity: 0 }
- StateChangeScript { script: block.destroy(1000); }
- }
- ]
-}
diff --git a/examples/quick/demos/samegame/content/SamegameText.qml b/examples/quick/demos/samegame/content/SamegameText.qml
deleted file mode 100644
index c69272bad3..0000000000
--- a/examples/quick/demos/samegame/content/SamegameText.qml
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2012 Research In Motion
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "."
-
-Text {
- font.pixelSize: Settings.fontPixelSize;
- color: "white";
- textFormat: Text.StyledText;
- Behavior on opacity { NumberAnimation {} }
-}
diff --git a/examples/quick/demos/samegame/content/Settings.qml b/examples/quick/demos/samegame/content/Settings.qml
deleted file mode 100644
index 2892198b27..0000000000
--- a/examples/quick/demos/samegame/content/Settings.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 BlackBerry Limited. All rights reserved.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-pragma Singleton
-import QtQml 2.0
-
-QtObject {
- property int screenHeight: 480
- property int screenWidth: 320
-
- property int menuDelay: 500
-
- property int headerHeight: 20 // 70 on BB10
- property int footerHeight: 44 // 100 on BB10
-
- property int fontPixelSize: 14 // 55 on BB10
-
- property int blockSize: 32 // 64 on BB10
-
- property int toolButtonHeight: 32 // 64 on BB10
-
- property int menuButtonSpacing: 0 // 15 on BB10
-}
diff --git a/examples/quick/demos/samegame/content/SimpleBlock.qml b/examples/quick/demos/samegame/content/SimpleBlock.qml
deleted file mode 100644
index eb2c458d4f..0000000000
--- a/examples/quick/demos/samegame/content/SimpleBlock.qml
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 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){
- "gfx/red.png";
- } else if (type == 1) {
- "gfx/blue.png";
- } else if (type == 2) {
- "gfx/green.png";
- } else {
- "gfx/yellow.png";
- }
- }
- opacity: 0
- Behavior on opacity { NumberAnimation { duration: 200 } }
- anchors.fill: parent
- }
-
- //Foreground particles
- BlockEmitter {
- id: particles
- system: particleSystem
- group: {
- if (type == 0){
- "red";
- } else if (type == 1) {
- "blue";
- } else if (type == 2) {
- "green";
- } else {
- "yellow";
- }
- }
- anchors.fill: parent
- }
-
- 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/quick/demos/samegame/content/SmokeText.qml b/examples/quick/demos/samegame/content/SmokeText.qml
deleted file mode 100644
index 1fc72010db..0000000000
--- a/examples/quick/demos/samegame/content/SmokeText.qml
+++ /dev/null
@@ -1,93 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-
-Item {
- z: 10
- property alias source: img.source
- property alias system: emitter.system
- property int playerNum: 1
- function play() {
- anim.running = true;
- }
- anchors.centerIn: parent
- Image {
- opacity: 0
- id: img
- anchors.centerIn: parent
- rotation: playerNum == 1 ? -8 : -5
- Emitter {
- id: emitter
- group: "smoke"
- anchors.fill: parent
- shape: MaskShape { source: img.source }
- enabled: false
- emitRate: 1000
- lifeSpan: 600
- size: 64
- endSize: 32
- velocity: AngleDirection { angleVariation: 360; magnitudeVariation: 160 }
- }
- }
- SequentialAnimation {
- id: anim
- running: false
- PauseAnimation { duration: 500}
- ParallelAnimation {
- NumberAnimation { target: img; property: "opacity"; from: 0.1; to: 1.0 }
- NumberAnimation { target: img; property: "scale"; from: 0.1; to: 1.0 }
- }
- PauseAnimation { duration: 250}
- ScriptAction { script: emitter.pulse(100); }
- NumberAnimation { target: img; property: "opacity"; from: 1.0; to: 0.0 }
- }
-}
diff --git a/examples/quick/demos/samegame/content/gfx/background-puzzle.png b/examples/quick/demos/samegame/content/gfx/background-puzzle.png
deleted file mode 100644
index c2eca5f5dc..0000000000
--- a/examples/quick/demos/samegame/content/gfx/background-puzzle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/background.png b/examples/quick/demos/samegame/content/gfx/background.png
deleted file mode 100644
index 60f57b650f..0000000000
--- a/examples/quick/demos/samegame/content/gfx/background.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/bar.png b/examples/quick/demos/samegame/content/gfx/bar.png
deleted file mode 100644
index 4953cd6221..0000000000
--- a/examples/quick/demos/samegame/content/gfx/bar.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/blue-puzzle.png b/examples/quick/demos/samegame/content/gfx/blue-puzzle.png
deleted file mode 100644
index e550d5935b..0000000000
--- a/examples/quick/demos/samegame/content/gfx/blue-puzzle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/blue.png b/examples/quick/demos/samegame/content/gfx/blue.png
deleted file mode 100644
index b8161c0f70..0000000000
--- a/examples/quick/demos/samegame/content/gfx/blue.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/bubble-highscore.png b/examples/quick/demos/samegame/content/gfx/bubble-highscore.png
deleted file mode 100644
index c4e38df824..0000000000
--- a/examples/quick/demos/samegame/content/gfx/bubble-highscore.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/bubble-puzzle.png b/examples/quick/demos/samegame/content/gfx/bubble-puzzle.png
deleted file mode 100644
index 278556bc8d..0000000000
--- a/examples/quick/demos/samegame/content/gfx/bubble-puzzle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-game-1.png b/examples/quick/demos/samegame/content/gfx/but-game-1.png
deleted file mode 100644
index 3343b7ff13..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-game-1.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-game-2.png b/examples/quick/demos/samegame/content/gfx/but-game-2.png
deleted file mode 100644
index afba106962..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-game-2.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-game-3.png b/examples/quick/demos/samegame/content/gfx/but-game-3.png
deleted file mode 100644
index adea77a687..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-game-3.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-game-4.png b/examples/quick/demos/samegame/content/gfx/but-game-4.png
deleted file mode 100644
index 18c922ba45..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-game-4.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-game-new.png b/examples/quick/demos/samegame/content/gfx/but-game-new.png
deleted file mode 100644
index 257e182585..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-game-new.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-menu.png b/examples/quick/demos/samegame/content/gfx/but-menu.png
deleted file mode 100644
index 8440e87759..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-menu.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-puzzle-next.png b/examples/quick/demos/samegame/content/gfx/but-puzzle-next.png
deleted file mode 100644
index 7e3ed417d0..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-puzzle-next.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/but-quit.png b/examples/quick/demos/samegame/content/gfx/but-quit.png
deleted file mode 100644
index 95c77ced94..0000000000
--- a/examples/quick/demos/samegame/content/gfx/but-quit.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/green-puzzle.png b/examples/quick/demos/samegame/content/gfx/green-puzzle.png
deleted file mode 100644
index 581f76fd8d..0000000000
--- a/examples/quick/demos/samegame/content/gfx/green-puzzle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/green.png b/examples/quick/demos/samegame/content/gfx/green.png
deleted file mode 100644
index da4cca5e7f..0000000000
--- a/examples/quick/demos/samegame/content/gfx/green.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/icon-fail.png b/examples/quick/demos/samegame/content/gfx/icon-fail.png
deleted file mode 100644
index 40726118a9..0000000000
--- a/examples/quick/demos/samegame/content/gfx/icon-fail.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/icon-ok.png b/examples/quick/demos/samegame/content/gfx/icon-ok.png
deleted file mode 100644
index 15a8442e94..0000000000
--- a/examples/quick/demos/samegame/content/gfx/icon-ok.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/icon-time.png b/examples/quick/demos/samegame/content/gfx/icon-time.png
deleted file mode 100644
index 9490e49e90..0000000000
--- a/examples/quick/demos/samegame/content/gfx/icon-time.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/logo-a.png b/examples/quick/demos/samegame/content/gfx/logo-a.png
deleted file mode 100644
index 20c20ba480..0000000000
--- a/examples/quick/demos/samegame/content/gfx/logo-a.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/logo-e.png b/examples/quick/demos/samegame/content/gfx/logo-e.png
deleted file mode 100644
index dd663f114a..0000000000
--- a/examples/quick/demos/samegame/content/gfx/logo-e.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/logo-g.png b/examples/quick/demos/samegame/content/gfx/logo-g.png
deleted file mode 100644
index a319bf9ffa..0000000000
--- a/examples/quick/demos/samegame/content/gfx/logo-g.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/logo-m.png b/examples/quick/demos/samegame/content/gfx/logo-m.png
deleted file mode 100644
index 6a029b3267..0000000000
--- a/examples/quick/demos/samegame/content/gfx/logo-m.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/logo-s.png b/examples/quick/demos/samegame/content/gfx/logo-s.png
deleted file mode 100644
index 963b17546a..0000000000
--- a/examples/quick/demos/samegame/content/gfx/logo-s.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/logo.png b/examples/quick/demos/samegame/content/gfx/logo.png
deleted file mode 100644
index e900eddb2f..0000000000
--- a/examples/quick/demos/samegame/content/gfx/logo.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/particle-brick.png b/examples/quick/demos/samegame/content/gfx/particle-brick.png
deleted file mode 100644
index 5c83896d22..0000000000
--- a/examples/quick/demos/samegame/content/gfx/particle-brick.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/particle-paint.png b/examples/quick/demos/samegame/content/gfx/particle-paint.png
deleted file mode 100644
index 9bd0a2a13f..0000000000
--- a/examples/quick/demos/samegame/content/gfx/particle-paint.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/particle-smoke.png b/examples/quick/demos/samegame/content/gfx/particle-smoke.png
deleted file mode 100644
index b27f954a79..0000000000
--- a/examples/quick/demos/samegame/content/gfx/particle-smoke.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/red-puzzle.png b/examples/quick/demos/samegame/content/gfx/red-puzzle.png
deleted file mode 100644
index 9ceb17e4d0..0000000000
--- a/examples/quick/demos/samegame/content/gfx/red-puzzle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/red.png b/examples/quick/demos/samegame/content/gfx/red.png
deleted file mode 100644
index 681810fe3b..0000000000
--- a/examples/quick/demos/samegame/content/gfx/red.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-highscore-new.png b/examples/quick/demos/samegame/content/gfx/text-highscore-new.png
deleted file mode 100644
index 50f7fcd0f6..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-highscore-new.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-highscore.png b/examples/quick/demos/samegame/content/gfx/text-highscore.png
deleted file mode 100644
index 7198c277b8..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-highscore.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-no-winner.png b/examples/quick/demos/samegame/content/gfx/text-no-winner.png
deleted file mode 100644
index b4a6685111..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-no-winner.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-p1-go.png b/examples/quick/demos/samegame/content/gfx/text-p1-go.png
deleted file mode 100644
index c7bd2a5e75..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-p1-go.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-p1-won.png b/examples/quick/demos/samegame/content/gfx/text-p1-won.png
deleted file mode 100644
index 41c2eb7c98..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-p1-won.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-p1.png b/examples/quick/demos/samegame/content/gfx/text-p1.png
deleted file mode 100644
index b59c87b977..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-p1.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-p2-go.png b/examples/quick/demos/samegame/content/gfx/text-p2-go.png
deleted file mode 100644
index f03cd93afa..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-p2-go.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-p2-won.png b/examples/quick/demos/samegame/content/gfx/text-p2-won.png
deleted file mode 100644
index 116b7f2e7a..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-p2-won.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/text-p2.png b/examples/quick/demos/samegame/content/gfx/text-p2.png
deleted file mode 100644
index d4f2bc7335..0000000000
--- a/examples/quick/demos/samegame/content/gfx/text-p2.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/yellow-puzzle.png b/examples/quick/demos/samegame/content/gfx/yellow-puzzle.png
deleted file mode 100644
index 66044c81b4..0000000000
--- a/examples/quick/demos/samegame/content/gfx/yellow-puzzle.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/gfx/yellow.png b/examples/quick/demos/samegame/content/gfx/yellow.png
deleted file mode 100644
index 6bc5d385e3..0000000000
--- a/examples/quick/demos/samegame/content/gfx/yellow.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/content/levels/TemplateBase.qml b/examples/quick/demos/samegame/content/levels/TemplateBase.qml
deleted file mode 100644
index 6501f277eb..0000000000
--- a/examples/quick/demos/samegame/content/levels/TemplateBase.qml
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-
-Rectangle{
- id: control
- property int scoreTarget: -1
- property int timeTarget: -1
- property int moveTarget: -1
- property bool mustClear: true
- property string goalText: "Clear the level..."
-
- property var startingGrid //If this isn't an array of ints, we will refuse to load the level.
- /* Ints are 0-4. If not enough ints are there it will be prepadded with 0s to fill the grid
- (which ruins everything if you have the wrong number of rows).
- 0 - No block
- 1 - Red
- 2 - Blue
- 3 - Green
- 4 - Yellow
- Ideas for future colors, but not supported in this version:
- 5 - Purple
- 6 - Cyan
- 7 - Gray
- 8 - Black
- 9 - White
- */
-
- width: 320
- height: 416
- color: "white" //TODO: Theme support for both setting themes per level, and seeing it in the control!
-}
diff --git a/examples/quick/demos/samegame/content/levels/level0.qml b/examples/quick/demos/samegame/content/levels/level0.qml
deleted file mode 100644
index 3c09b1f3d3..0000000000
--- a/examples/quick/demos/samegame/content/levels/level0.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- moveTarget: 3
- goalText: "1 of 10<br><br>Clear in three moves..."
- startingGrid: [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 ,
- 0 , 0 , 0 , 0 , 0 , 1 , 1 , 2 , 1 , 1 ,
- 0 , 0 , 0 , 1 , 1 , 3 , 3 , 3 , 3 , 3 ,
- 0 , 1 , 1 , 3 , 3 , 3 , 1 , 3 , 1 , 1 ,
- 1 , 2 , 3 , 3 , 1 , 1 , 3 , 3 , 3 , 3 ,
- 1 , 3 , 3 , 2 , 3 , 3 , 3 , 3 , 1 , 1 ,
- 1 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level1.qml b/examples/quick/demos/samegame/content/levels/level1.qml
deleted file mode 100644
index 29ad09cf0e..0000000000
--- a/examples/quick/demos/samegame/content/levels/level1.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- timeTarget: 10
- goalText: "2 of 10<br><br>Clear in 10 seconds..."
- startingGrid: [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 1 , 3 , 3 , 3 , 1 , 1 , 1 , 1 , 2 , 2 ,
- 1 , 2 , 3 , 3 , 3 , 1 , 1 , 1 , 1 , 2 ,
- 2 , 2 , 1 , 3 , 3 , 3 , 1 , 1 , 1 , 2 ,
- 2 , 1 , 1 , 1 , 3 , 3 , 3 , 1 , 2 , 2 ,
- 1 , 1 , 1 , 1 , 1 , 3 , 3 , 3 , 2 , 1 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level2.qml b/examples/quick/demos/samegame/content/levels/level2.qml
deleted file mode 100644
index 830776223c..0000000000
--- a/examples/quick/demos/samegame/content/levels/level2.qml
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- scoreTarget: 1200
- timeTarget: 60
- goalText: "3 of 10<br><br>Score over 1200 points in one minute..."
- mustClear: false
- startingGrid: [ 3 , 1 , 2 , 1 , 1 , 2 , 1 , 1 , 3 , 3 ,
- 1 , 3 , 3 , 2 , 3 , 3 , 1 , 1 , 3 , 1 ,
- 3 , 1 , 3 , 3 , 2 , 3 , 3 , 3 , 1 , 2 ,
- 3 , 2 , 2 , 1 , 3 , 3 , 2 , 1 , 1 , 2 ,
- 3 , 1 , 2 , 2 , 2 , 2 , 2 , 1 , 3 , 1 ,
- 2 , 3 , 1 , 2 , 2 , 3 , 3 , 1 , 3 , 2 ,
- 3 , 2 , 1 , 1 , 3 , 3 , 3 , 2 , 2 , 1 ,
- 1 , 2 , 2 , 3 , 2 , 3 , 3 , 3 , 1 , 1 ,
- 1 , 3 , 3 , 3 , 1 , 2 , 2 , 3 , 3 , 1 ,
- 3 , 3 , 2 , 1 , 2 , 2 , 1 , 1 , 1 , 3 ,
- 2 , 1 , 3 , 2 , 3 , 2 , 3 , 2 , 2 , 1 ,
- 1 , 3 , 1 , 2 , 1 , 2 , 3 , 1 , 2 , 2 ,
- 1 , 2 , 2 , 2 , 1 , 1 , 2 , 3 , 1 , 2 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level3.qml b/examples/quick/demos/samegame/content/levels/level3.qml
deleted file mode 100644
index 91b03a1658..0000000000
--- a/examples/quick/demos/samegame/content/levels/level3.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- scoreTarget: 3000
- timeTarget: 60
- goalText: "4 of 10<br>Clear the board with over 3000 points in under a minute..."
- startingGrid: [ 3 , 3 , 1 , 1 , 1 , 2 , 2 , 4 , 3 , 3 ,
- 4 , 3 , 1 , 4 , 2 , 2 , 2 , 4 , 3 , 4 ,
- 4 , 3 , 3 , 4 , 1 , 1 , 3 , 3 , 4 , 4 ,
- 3 , 3 , 3 , 3 , 3 , 1 , 3 , 2 , 2 , 4 ,
- 4 , 4 , 3 , 4 , 3 , 1 , 4 , 4 , 4 , 4 ,
- 4 , 4 , 3 , 4 , 1 , 1 , 4 , 4 , 3 , 3 ,
- 4 , 2 , 2 , 2 , 2 , 2 , 4 , 4 , 4 , 1 ,
- 4 , 4 , 2 , 4 , 2 , 2 , 1 , 1 , 1 , 1 ,
- 4 , 4 , 2 , 4 , 2 , 2 , 1 , 4 , 4 , 1 ,
- 4 , 1 , 1 , 4 , 3 , 3 , 4 , 2 , 4 , 1 ,
- 4 , 1 , 1 , 2 , 3 , 3 , 4 , 2 , 2 , 1 ,
- 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 2 , 1 ,
- 4 , 1 , 1 , 2 , 2 , 3 , 4 , 3 , 4 , 4 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level4.qml b/examples/quick/demos/samegame/content/levels/level4.qml
deleted file mode 100644
index 589d386845..0000000000
--- a/examples/quick/demos/samegame/content/levels/level4.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- goalText: "5 of 10<br><br>Clear the level..."
- startingGrid: [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
- 1 , 3 , 2 , 1 , 1 , 1 , 1 , 3 , 2 , 3 ,
- 1 , 2 , 3 , 1 , 3 , 2 , 2 , 1 , 1 , 2 ,
- 3 , 2 , 2 , 2 , 1 , 1 , 1 , 1 , 3 , 3 ,
- 2 , 1 , 1 , 3 , 2 , 1 , 1 , 2 , 1 , 3 ,
- 1 , 3 , 3 , 1 , 2 , 1 , 2 , 1 , 3 , 3 ,
- 1 , 3 , 2 , 2 , 2 , 1 , 1 , 3 , 2 , 3 ,
- 1 , 1 , 3 , 2 , 3 , 3 , 2 , 1 , 1 , 1 ,
- 1 , 2 , 2 , 3 , 2 , 2 , 1 , 3 , 1 , 3 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level5.qml b/examples/quick/demos/samegame/content/levels/level5.qml
deleted file mode 100644
index 78ee6eb355..0000000000
--- a/examples/quick/demos/samegame/content/levels/level5.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- moveTarget: 4
- goalText: "6 of 10<br><br>Clear in four or less moves..."
- startingGrid: [ 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ,
- 4 , 2 , 2 , 2 , 4 , 3 , 3 , 3 , 4 , 4 ,
- 4 , 2 , 4 , 4 , 4 , 3 , 2 , 3 , 4 , 4 ,
- 4 , 2 , 2 , 2 , 4 , 3 , 3 , 3 , 4 , 4 ,
- 4 , 4 , 4 , 2 , 4 , 3 , 4 , 3 , 4 , 4 ,
- 4 , 2 , 2 , 2 , 4 , 3 , 4 , 3 , 4 , 4 ,
- 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ,
- 4 , 3 , 4 , 3 , 4 , 2 , 2 , 2 , 4 , 3 ,
- 4 , 3 , 3 , 3 , 4 , 2 , 4 , 4 , 4 , 3 ,
- 4 , 3 , 3 , 3 , 4 , 2 , 2 , 2 , 4 , 3 ,
- 4 , 3 , 4 , 3 , 4 , 2 , 4 , 4 , 4 , 4 ,
- 4 , 3 , 4 , 3 , 4 , 2 , 2 , 2 , 4 , 3 ,
- 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level6.qml b/examples/quick/demos/samegame/content/levels/level6.qml
deleted file mode 100644
index 3e56808dc7..0000000000
--- a/examples/quick/demos/samegame/content/levels/level6.qml
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- moveTarget: 20
- timeTarget: 40
- goalText: "7 of 10<br><br>Clear with 20 moves in 40 seconds (or better)."
- startingGrid: [ 1 , 3 , 1 , 1 , 1 , 1 , 2 , 1 , 2 , 2 ,
- 2 , 1 , 2 , 3 , 3 , 1 , 3 , 1 , 1 , 3 ,
- 3 , 1 , 1 , 1 , 2 , 2 , 3 , 2 , 3 , 1 ,
- 1 , 3 , 1 , 1 , 3 , 1 , 1 , 1 , 2 , 3 ,
- 2 , 1 , 1 , 1 , 3 , 2 , 3 , 3 , 2 , 3 ,
- 3 , 3 , 3 , 3 , 2 , 2 , 3 , 1 , 3 , 2 ,
- 2 , 2 , 3 , 2 , 2 , 3 , 2 , 2 , 2 , 2 ,
- 1 , 2 , 1 , 2 , 1 , 3 , 2 , 3 , 2 , 3 ,
- 1 , 1 , 2 , 3 , 3 , 3 , 3 , 1 , 1 , 2 ,
- 3 , 3 , 2 , 2 , 2 , 2 , 3 , 1 , 3 , 1 ,
- 1 , 2 , 3 , 3 , 3 , 1 , 3 , 2 , 1 , 2 ,
- 1 , 2 , 1 , 1 , 2 , 3 , 1 , 2 , 1 , 3 ,
- 3 , 1 , 2 , 2 , 1 , 3 , 3 , 1 , 3 , 2 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level7.qml b/examples/quick/demos/samegame/content/levels/level7.qml
deleted file mode 100644
index 2e412a0c79..0000000000
--- a/examples/quick/demos/samegame/content/levels/level7.qml
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- goalText: "8 of 10<br><br>Clear the grid."
- startingGrid: [ 2 , 4 , 3 , 2 , 3 , 2 , 3 , 3 , 4 , 3 ,
- 2 , 2 , 3 , 3 , 1 , 4 , 3 , 3 , 3 , 2 ,
- 1 , 4 , 2 , 3 , 4 , 3 , 3 , 1 , 1 , 1 ,
- 2 , 1 , 2 , 4 , 4 , 2 , 2 , 3 , 2 , 1 ,
- 3 , 4 , 4 , 1 , 3 , 2 , 4 , 2 , 1 , 1 ,
- 2 , 2 , 3 , 1 , 2 , 4 , 1 , 2 , 1 , 2 ,
- 1 , 2 , 3 , 2 , 4 , 4 , 3 , 1 , 1 , 2 ,
- 4 , 4 , 2 , 1 , 2 , 4 , 2 , 2 , 4 , 3 ,
- 4 , 2 , 4 , 1 , 3 , 4 , 1 , 4 , 2 , 4 ,
- 4 , 3 , 4 , 1 , 4 , 3 , 1 , 3 , 1 , 1 ,
- 3 , 3 , 2 , 3 , 2 , 4 , 1 , 2 , 4 , 4 ,
- 3 , 4 , 2 , 2 , 4 , 3 , 4 , 1 , 3 , 2 ,
- 4 , 3 , 3 , 4 , 2 , 4 , 1 , 2 , 3 , 2 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level8.qml b/examples/quick/demos/samegame/content/levels/level8.qml
deleted file mode 100644
index 18daa76286..0000000000
--- a/examples/quick/demos/samegame/content/levels/level8.qml
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- scoreTarget: 1000
- goalText: "9 of 10<br><br>Score over 1000 points"
- startingGrid: [ 1 , 4 , 4 , 3 , 2 , 1 , 4 , 2 , 4 , 2 ,
- 2 , 3 , 4 , 4 , 1 , 1 , 1 , 4 , 4 , 4 ,
- 1 , 3 , 1 , 2 , 2 , 1 , 2 , 1 , 4 , 2 ,
- 4 , 3 , 4 , 2 , 1 , 4 , 1 , 2 , 2 , 3 ,
- 3 , 4 , 2 , 4 , 4 , 3 , 2 , 2 , 2 , 1 ,
- 4 , 4 , 3 , 2 , 4 , 4 , 2 , 1 , 1 , 1 ,
- 1 , 2 , 1 , 3 , 4 , 1 , 1 , 3 , 2 , 3 ,
- 3 , 4 , 2 , 2 , 1 , 3 , 2 , 2 , 4 , 2 ,
- 2 , 4 , 1 , 2 , 2 , 4 , 3 , 3 , 3 , 1 ,
- 1 , 2 , 2 , 4 , 1 , 2 , 2 , 3 , 3 , 3 ,
- 4 , 4 , 1 , 4 , 3 , 1 , 3 , 3 , 3 , 4 ,
- 1 , 2 , 4 , 1 , 2 , 1 , 1 , 4 , 2 , 1 ,
- 1 , 2 , 3 , 4 , 2 , 4 , 4 , 2 , 1 , 3 ]
-}
diff --git a/examples/quick/demos/samegame/content/levels/level9.qml b/examples/quick/demos/samegame/content/levels/level9.qml
deleted file mode 100644
index 38d6673189..0000000000
--- a/examples/quick/demos/samegame/content/levels/level9.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-TemplateBase{
- scoreTarget: 2000
- timeTarget: 60
- moveTarget: 20
- mustClear: false
- goalText: "10 of 10<br><br>Score 2000 in one minute with less than 20 moves!"
- startingGrid: [ 3 , 2 , 3 , 1 , 3 , 3 , 4 , 1 , 3 , 3 ,
- 2 , 3 , 2 , 1 , 1 , 2 , 2 , 2 , 4 , 1 ,
- 2 , 4 , 4 , 4 , 3 , 1 , 4 , 4 , 4 , 1 ,
- 3 , 1 , 3 , 4 , 4 , 2 , 2 , 2 , 2 , 3 ,
- 2 , 1 , 4 , 4 , 3 , 3 , 1 , 1 , 3 , 2 ,
- 3 , 2 , 1 , 4 , 3 , 4 , 1 , 3 , 4 , 2 ,
- 3 , 3 , 1 , 4 , 4 , 4 , 2 , 1 , 2 , 3 ,
- 2 , 3 , 4 , 3 , 4 , 1 , 1 , 3 , 2 , 4 ,
- 4 , 4 , 1 , 2 , 4 , 3 , 2 , 2 , 2 , 4 ,
- 1 , 4 , 2 , 2 , 1 , 1 , 2 , 1 , 1 , 4 ,
- 1 , 4 , 3 , 3 , 3 , 1 , 3 , 4 , 4 , 2 ,
- 3 , 4 , 1 , 1 , 2 , 2 , 2 , 3 , 2 , 1 ,
- 3 , 3 , 4 , 3 , 1 , 1 , 1 , 4 , 4 , 3 ]
-}
diff --git a/examples/quick/demos/samegame/content/qmldir b/examples/quick/demos/samegame/content/qmldir
deleted file mode 100644
index 3b552ec1f1..0000000000
--- a/examples/quick/demos/samegame/content/qmldir
+++ /dev/null
@@ -1,13 +0,0 @@
-singleton Settings 1.0 Settings.qml
-Block 1.0 Block.qml
-BlockEmitter 1.0 BlockEmitter.qml
-Button 1.0 Button.qml
-GameArea 1.0 GameArea.qml
-LogoAnimation 1.0 LogoAnimation.qml
-MenuEmitter 1.0 MenuEmitter.qml
-PaintEmitter 1.0 PaintEmitter.qml
-PrimaryPack 1.0 PrimaryPack.qml
-PuzzleBlock 1.0 PuzzleBlock.qml
-SamegameText 1.0 SamegameText.qml
-SimpleBlock 1.0 SimpleBlock.qml
-SmokeText 1.0 SmokeText.qml
diff --git a/examples/quick/demos/samegame/content/samegame.js b/examples/quick/demos/samegame/content/samegame.js
deleted file mode 100644
index 0e2cd4ea5b..0000000000
--- a/examples/quick/demos/samegame/content/samegame.js
+++ /dev/null
@@ -1,590 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/* This script file handles the game logic */
-.pragma library
-.import QtQuick.LocalStorage 2.0 as Sql
-
-var maxColumn = 10;
-var maxRow = 13;
-var types = 3;
-var maxIndex = maxColumn*maxRow;
-var board = new Array(maxIndex);
-var blockSrc = "Block.qml";
-var gameDuration;
-var component = Qt.createComponent(blockSrc);
-var gameCanvas;
-var betweenTurns = false;
-
-var puzzleLevel = null;
-var puzzlePath = "";
-
-var gameMode = "arcade"; //Set in new game, then tweaks behaviour of other functions
-var gameOver = false;
-
-function changeBlock(src)
-{
- blockSrc = src;
- component = Qt.createComponent(blockSrc);
-}
-
-// Index function used instead of a 2D array
-function index(column, row)
-{
- return column + row * maxColumn;
-}
-
-function timeStr(msecs)
-{
- var secs = Math.floor(msecs/1000);
- var m = Math.floor(secs/60);
- var ret = "" + m + "m " + (secs%60) + "s";
- return ret;
-}
-
-function cleanUp()
-{
- if (gameCanvas == undefined)
- return;
- // Delete blocks from previous game
- for (var i = 0; i < maxIndex; i++) {
- if (board[i] != null)
- board[i].destroy();
- board[i] = null;
- }
- if (puzzleLevel != null){
- puzzleLevel.destroy();
- puzzleLevel = null;
- }
- gameCanvas.mode = ""
-}
-
-function startNewGame(gc, mode, map)
-{
- gameCanvas = gc;
- if (mode == undefined)
- gameMode = "arcade";
- else
- gameMode = mode;
- gameOver = false;
-
- cleanUp();
-
- gc.gameOver = false;
- gc.mode = gameMode;
- // Calculate board size
- maxColumn = Math.floor(gameCanvas.width/gameCanvas.blockSize);
- maxRow = Math.floor(gameCanvas.height/gameCanvas.blockSize);
- maxIndex = maxRow * maxColumn;
- if (gameMode == "arcade") //Needs to be after board sizing
- getHighScore();
-
-
- // Initialize Board
- board = new Array(maxIndex);
- gameCanvas.score = 0;
- gameCanvas.score2 = 0;
- gameCanvas.moves = 0;
- gameCanvas.curTurn = 1;
- if (gameMode == "puzzle")
- loadMap(map);
- else//Note that we load them in reverse order for correct visual stacking
- for (var column = maxColumn - 1; column >= 0; column--)
- for (var row = maxRow - 1; row >= 0; row--)
- createBlock(column, row);
- if (gameMode == "puzzle")
- getLevelHistory();//Needs to be after map load
- gameDuration = new Date();
-}
-
-var fillFound; // Set after a floodFill call to the number of blocks found
-var floodBoard; // Set to 1 if the floodFill reaches off that node
-
-// NOTE: Be careful with vars named x,y, as the calling object's x,y are still in scope
-function handleClick(x,y)
-{
- if (betweenTurns || gameOver || gameCanvas == undefined)
- return;
- var column = Math.floor(x/gameCanvas.blockSize);
- var row = Math.floor(y/gameCanvas.blockSize);
- if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)
- return;
- if (board[index(column, row)] == null)
- return;
- // If it's a valid block, remove it and all connected (does nothing if it's not connected)
- floodFill(column,row, -1);
- if (fillFound <= 0)
- return;
- if (gameMode == "multiplayer" && gameCanvas.curTurn == 2)
- gameCanvas.score2 += (fillFound - 1) * (fillFound - 1);
- else
- gameCanvas.score += (fillFound - 1) * (fillFound - 1);
- if (gameMode == "multiplayer" && gameCanvas.curTurn == 2)
- shuffleUp();
- else
- shuffleDown();
- gameCanvas.moves += 1;
- if (gameMode == "endless")
- refill();
- else if (gameMode != "multiplayer")
- victoryCheck();
- if (gameMode == "multiplayer" && !gc.gameOver){
- betweenTurns = true;
- gameCanvas.swapPlayers();//signal, animate and call turnChange() when ready
- }
-}
-
-function floodFill(column,row,type)
-{
- if (board[index(column, row)] == null)
- return;
- var first = false;
- if (type == -1) {
- first = true;
- type = board[index(column,row)].type;
-
- // Flood fill initialization
- fillFound = 0;
- floodBoard = new Array(maxIndex);
- }
- if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)
- return;
- if (floodBoard[index(column, row)] == 1 || (!first && type != board[index(column, row)].type))
- return;
- floodBoard[index(column, row)] = 1;
- floodFill(column + 1, row, type);
- floodFill(column - 1, row, type);
- floodFill(column, row + 1, type);
- floodFill(column, row - 1, type);
- if (first == true && fillFound == 0)
- return; // Can't remove single blocks
- board[index(column, row)].dying = true;
- board[index(column, row)] = null;
- fillFound += 1;
-}
-
-function shuffleDown()
-{
- // Fall down
- for (var column = 0; column < maxColumn; column++) {
- var fallDist = 0;
- for (var row = maxRow - 1; row >= 0; row--) {
- if (board[index(column,row)] == null) {
- fallDist += 1;
- } else {
- if (fallDist > 0) {
- var obj = board[index(column, row)];
- obj.y = (row + fallDist) * gameCanvas.blockSize;
- board[index(column, row + fallDist)] = obj;
- board[index(column, row)] = null;
- }
- }
- }
- }
- // Fall to the left
- fallDist = 0;
- for (column = 0; column < maxColumn; column++) {
- if (board[index(column, maxRow - 1)] == null) {
- fallDist += 1;
- } else {
- if (fallDist > 0) {
- for (row = 0; row < maxRow; row++) {
- obj = board[index(column, row)];
- if (obj == null)
- continue;
- obj.x = (column - fallDist) * gameCanvas.blockSize;
- board[index(column - fallDist,row)] = obj;
- board[index(column, row)] = null;
- }
- }
- }
- }
-}
-
-
-function shuffleUp()
-{
- // Fall up
- for (var column = 0; column < maxColumn; column++) {
- var fallDist = 0;
- for (var row = 0; row < maxRow; row++) {
- if (board[index(column,row)] == null) {
- fallDist += 1;
- } else {
- if (fallDist > 0) {
- var obj = board[index(column, row)];
- obj.y = (row - fallDist) * gameCanvas.blockSize;
- board[index(column, row - fallDist)] = obj;
- board[index(column, row)] = null;
- }
- }
- }
- }
- // Fall to the left (or should it be right, so as to be left for P2?)
- fallDist = 0;
- for (column = 0; column < maxColumn; column++) {
- if (board[index(column, 0)] == null) {
- fallDist += 1;
- } else {
- if (fallDist > 0) {
- for (row = 0; row < maxRow; row++) {
- obj = board[index(column, row)];
- if (obj == null)
- continue;
- obj.x = (column - fallDist) * gameCanvas.blockSize;
- board[index(column - fallDist,row)] = obj;
- board[index(column, row)] = null;
- }
- }
- }
- }
-}
-
-function turnChange()//called by ui outside
-{
- betweenTurns = false;
- if (gameCanvas.curTurn == 1){
- shuffleUp();
- gameCanvas.curTurn = 2;
- victoryCheck();
- }else{
- shuffleDown();
- gameCanvas.curTurn = 1;
- victoryCheck();
- }
-}
-
-function refill()
-{
- for (var column = 0; column < maxColumn; column++) {
- for (var row = 0; row < maxRow; row++) {
- if (board[index(column, row)] == null)
- createBlock(column, row);
- }
- }
-}
-
-function victoryCheck()
-{
- // Awards bonuses for no blocks left
- var deservesBonus = true;
- if (board[index(0,maxRow - 1)] != null || board[index(0,0)] != null)
- deservesBonus = false;
- // Checks for game over
- if (deservesBonus){
- if (gameCanvas.curTurn = 1)
- gameCanvas.score += 1000;
- else
- gameCanvas.score2 += 1000;
- }
- gameOver = deservesBonus;
- if (gameCanvas.curTurn == 1){
- if (!(floodMoveCheck(0, maxRow - 1, -1)))
- gameOver = true;
- }else{
- if (!(floodMoveCheck(0, 0, -1, true)))
- gameOver = true;
- }
- if (gameMode == "puzzle"){
- puzzleVictoryCheck(deservesBonus);//Takes it from here
- return;
- }
- if (gameOver) {
- var winnerScore = Math.max(gameCanvas.score, gameCanvas.score2);
- if (gameMode == "multiplayer"){
- gameCanvas.score = winnerScore;
- saveHighScore(gameCanvas.score2);
- }
- saveHighScore(gameCanvas.score);
- gameDuration = new Date() - gameDuration;
- gameCanvas.gameOver = true;
- }
-}
-
-// Only floods up and right, to see if it can find adjacent same-typed blocks
-function floodMoveCheck(column, row, type, goDownInstead)
-{
- if (column >= maxColumn || column < 0 || row >= maxRow || row < 0)
- return false;
- if (board[index(column, row)] == null)
- return false;
- var myType = board[index(column, row)].type;
- if (type == myType)
- return true;
- if (goDownInstead)
- return floodMoveCheck(column + 1, row, myType, goDownInstead) ||
- floodMoveCheck(column, row + 1, myType, goDownInstead);
- else
- return floodMoveCheck(column + 1, row, myType) ||
- floodMoveCheck(column, row - 1, myType);
-}
-
-function createBlock(column,row,type)
-{
- // Note that we don't wait for the component to become ready. This will
- // only work if the block QML is a local file. Otherwise the component will
- // not be ready immediately. There is a statusChanged signal on the
- // component you could use if you want to wait to load remote files.
- if (component.status == 1){
- if (type == undefined)
- type = Math.floor(Math.random() * types);
- if (type < 0 || type > 4) {
- console.log("Invalid type requested");//TODO: Is this triggered by custom levels much?
- return;
- }
- var dynamicObject = component.createObject(gameCanvas,
- {"type": type,
- "x": column*gameCanvas.blockSize,
- "y": -1*gameCanvas.blockSize,
- "width": gameCanvas.blockSize,
- "height": gameCanvas.blockSize,
- "particleSystem": gameCanvas.ps});
- if (dynamicObject == null){
- console.log("error creating block");
- console.log(component.errorString());
- return false;
- }
- dynamicObject.y = row*gameCanvas.blockSize;
- dynamicObject.spawned = true;
-
- board[index(column,row)] = dynamicObject;
- }else{
- console.log("error loading block component");
- console.log(component.errorString());
- return false;
- }
- return true;
-}
-
-function showPuzzleError(str)
-{
- //TODO: Nice user visible UI?
- console.log(str);
-}
-
-function loadMap(map)
-{
- puzzlePath = map;
- var levelComp = Qt.createComponent(puzzlePath);
- if (levelComp.status != 1){
- console.log("Error loading level");
- showPuzzleError(levelComp.errorString());
- return;
- }
- puzzleLevel = levelComp.createObject();
- if (puzzleLevel == null || !puzzleLevel.startingGrid instanceof Array) {
- showPuzzleError("Bugger!");
- return;
- }
- gameCanvas.showPuzzleGoal(puzzleLevel.goalText);
- //showPuzzleGoal should call finishLoadingMap as the next thing it does, before handling more events
-}
-
-function finishLoadingMap()
-{
- for (var i in puzzleLevel.startingGrid)
- if (! (puzzleLevel.startingGrid[i] >= 0 && puzzleLevel.startingGrid[i] <= 9) )
- puzzleLevel.startingGrid[i] = 0;
- //TODO: Don't allow loading larger levels, leads to cheating
- while (puzzleLevel.startingGrid.length > maxIndex) puzzleLevel.startingGrid.shift();
- while (puzzleLevel.startingGrid.length < maxIndex) puzzleLevel.startingGrid.unshift(0);
- for (var i in puzzleLevel.startingGrid)
- if (puzzleLevel.startingGrid[i] > 0)
- createBlock(i % maxColumn, Math.floor(i / maxColumn), puzzleLevel.startingGrid[i] - 1);
-
- //### Experimental feature - allow levels to contain arbitrary QML scenes as well!
- //while (puzzleLevel.children.length)
- // puzzleLevel.children[0].parent = gameCanvas;
- gameDuration = new Date(); //Don't start until we finish loading
-}
-
-function puzzleVictoryCheck(clearedAll)//gameOver has also been set if no more moves
-{
- var won = true;
- var soFar = new Date() - gameDuration;
- if (puzzleLevel.scoreTarget != -1 && gameCanvas.score < puzzleLevel.scoreTarget){
- won = false;
- } if (puzzleLevel.scoreTarget != -1 && gameCanvas.score >= puzzleLevel.scoreTarget && !puzzleLevel.mustClear){
- gameOver = true;
- } if (puzzleLevel.timeTarget != -1 && soFar/1000.0 > puzzleLevel.timeTarget){
- gameOver = true;
- } if (puzzleLevel.moveTarget != -1 && gameCanvas.moves >= puzzleLevel.moveTarget){
- gameOver = true;
- } if (puzzleLevel.mustClear && gameOver && !clearedAll) {
- won = false;
- }
-
- if (gameOver) {
- gameCanvas.gameOver = true;
- gameCanvas.showPuzzleEnd(won);
-
- if (won) {
- // Store progress
- saveLevelHistory();
- }
- }
-}
-
-function getHighScore()
-{
- var db = Sql.LocalStorage.openDatabaseSync(
- "SameGame",
- "2.0",
- "SameGame Local Data",
- 100
- );
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(game TEXT, score NUMBER, gridSize TEXT, time NUMBER)');
- // Only show results for the current grid size
- var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'
- + maxColumn + "x" + maxRow + '" AND game = "' + gameMode + '" ORDER BY score desc');
- if (rs.rows.length > 0)
- gameCanvas.highScore = rs.rows.item(0).score;
- else
- gameCanvas.highScore = 0;
- }
- );
-}
-
-function saveHighScore(score)
-{
- // Offline storage
- var db = Sql.LocalStorage.openDatabaseSync(
- "SameGame",
- "2.0",
- "SameGame Local Data",
- 100
- );
- var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)";
- var data = [
- gameMode,
- score,
- maxColumn + "x" + maxRow,
- Math.floor(gameDuration / 1000)
- ];
- if (score >= gameCanvas.highScore)//Update UI field
- gameCanvas.highScore = score;
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(game TEXT, score NUMBER, gridSize TEXT, time NUMBER)');
- tx.executeSql(dataStr, data);
- }
- );
-}
-
-function getLevelHistory()
-{
- var db = Sql.LocalStorage.openDatabaseSync(
- "SameGame",
- "2.0",
- "SameGame Local Data",
- 100
- );
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Puzzle(level TEXT, score NUMBER, moves NUMBER, time NUMBER)');
- var rs = tx.executeSql('SELECT * FROM Puzzle WHERE level = "' + puzzlePath + '" ORDER BY score desc');
- if (rs.rows.length > 0) {
- gameCanvas.puzzleWon = true;
- gameCanvas.highScore = rs.rows.item(0).score;
- } else {
- gameCanvas.puzzleWon = false;
- gameCanvas.highScore = 0;
- }
- }
- );
-}
-
-function saveLevelHistory()
-{
- var db = Sql.LocalStorage.openDatabaseSync(
- "SameGame",
- "2.0",
- "SameGame Local Data",
- 100
- );
- var dataStr = "INSERT INTO Puzzle VALUES(?, ?, ?, ?)";
- var data = [
- puzzlePath,
- gameCanvas.score,
- gameCanvas.moves,
- Math.floor(gameDuration / 1000)
- ];
- gameCanvas.puzzleWon = true;
-
- db.transaction(
- function(tx) {
- tx.executeSql('CREATE TABLE IF NOT EXISTS Puzzle(level TEXT, score NUMBER, moves NUMBER, time NUMBER)');
- tx.executeSql(dataStr, data);
- }
- );
-}
-
-function nuke() //For "Debug mode"
-{
- for (var row = 1; row <= 5; row++) {
- for (var col = 0; col < 5; col++) {
- if (board[index(col, maxRow - row)] != null) {
- board[index(col, maxRow - row)].dying = true;
- board[index(col, maxRow - row)] = null;
- }
- }
- }
- if (gameMode == "multiplayer" && gameCanvas.curTurn == 2)
- shuffleUp();
- else
- shuffleDown();
- if (gameMode == "endless")
- refill();
- else
- victoryCheck();
-}
diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png
deleted file mode 100644
index cce9f11017..0000000000
--- a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-1.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png b/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png
deleted file mode 100644
index ca9e8368b1..0000000000
--- a/examples/quick/demos/samegame/doc/images/qtquick-demo-samegame-med-2.png
+++ /dev/null
Binary files differ
diff --git a/examples/quick/demos/samegame/doc/src/samegame.qdoc b/examples/quick/demos/samegame/doc/src/samegame.qdoc
deleted file mode 100644
index 25d0376c8e..0000000000
--- a/examples/quick/demos/samegame/doc/src/samegame.qdoc
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** 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. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \title Qt Quick Demo - Same Game
- \ingroup qtquickdemos
- \example demos/samegame
- \brief A QML implementation of the popular puzzle game by Kuniaki Moribe.
-
- \e{Same Game} demonstrates a QML game with custom types and logic written in
- JavaScript. The game uses various \l{Qt Quick} features such as
- particles, animation, and loading images.
-
- \image qtquick-demo-samegame-med-1.png
- \image qtquick-demo-samegame-med-2.png
-
- For more details about different parts of the example, see
- \l{QML Advanced Tutorial}.
-
- \include examples-run.qdocinc
-
- \sa {QML Applications}
-*/
diff --git a/examples/quick/demos/samegame/main.cpp b/examples/quick/demos/samegame/main.cpp
deleted file mode 100644
index d2ccd84cf6..0000000000
--- a/examples/quick/demos/samegame/main.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "../../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(demos/samegame/samegame)
diff --git a/examples/quick/demos/samegame/samegame.pro b/examples/quick/demos/samegame/samegame.pro
deleted file mode 100644
index 7b680490ad..0000000000
--- a/examples/quick/demos/samegame/samegame.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = app
-
-QT += qml quick sql
-SOURCES += main.cpp
-RESOURCES += samegame.qrc
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/samegame
-INSTALLS += target
diff --git a/examples/quick/demos/samegame/samegame.qml b/examples/quick/demos/samegame/samegame.qml
deleted file mode 100644
index 6045c512f9..0000000000
--- a/examples/quick/demos/samegame/samegame.qml
+++ /dev/null
@@ -1,382 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Particles 2.0
-import "content/samegame.js" as Logic
-import "content"
-
-Rectangle {
- id: root
- width: Settings.screenWidth; height: Settings.screenHeight
- property int acc: 0
-
-
- function loadPuzzle() {
- if (gameCanvas.mode != "")
- Logic.cleanUp();
- Logic.startNewGame(gameCanvas,"puzzle","levels/level"+acc+".qml")
- }
- function nextPuzzle() {
- acc = (acc + 1) % 10;
- loadPuzzle();
- }
- Timer {
- id: gameOverTimer
- interval: 1500
- running : gameCanvas.gameOver && gameCanvas.mode == "puzzle" //mode will be reset by cleanUp();
- repeat : false
- onTriggered: {
- Logic.cleanUp();
- nextPuzzle();
- }
- }
-
- Image {
- source: "content/gfx/background.png"
- anchors.fill: parent
- }
-
- GameArea {
- id: gameCanvas
- z: 1
- y: Settings.headerHeight
-
- width: parent.width
- height: parent.height - Settings.headerHeight - Settings.footerHeight
-
- backgroundVisible: root.state == "in-game"
- onModeChanged: if (gameCanvas.mode != "puzzle") puzzleWon = false; //UI has stricter constraints on this variable than the game does
- Age {
- groups: ["redspots", "greenspots", "bluespots", "yellowspots"]
- enabled: root.state == ""
- system: gameCanvas.ps
- }
-
- onPuzzleLost: acc--;//So that nextPuzzle() reloads the current one
-
- }
-
- Item {
- id: menu
- z: 2
- width: parent.width;
- anchors.top: parent.top
- anchors.bottom: bottomBar.top
-
- LogoAnimation {
- x: 64
- y: Settings.headerHeight
- particleSystem: gameCanvas.ps
- running: root.state == ""
- }
- Row {
- x: 112
- y: 20
- Image { source: "content/gfx/logo-a.png" }
- Image { source: "content/gfx/logo-m.png" }
- Image { source: "content/gfx/logo-e.png" }
- }
-
- Column {
- y: 100 + 40
- spacing: Settings.menuButtonSpacing
- width: parent.width
- height: parent.height - (140 + Settings.footerHeight)
-
- Button {
- width: root.width
- rotatedButton: true
- imgSrc: "content/gfx/but-game-1.png"
- onClicked: {
- if (root.state == "in-game")
- return //Prevent double clicking
- root.state = "in-game"
- gameCanvas.blockFile = "Block.qml"
- gameCanvas.background = "gfx/background.png"
- arcadeTimer.start();
- }
- //Emitted particles don't fade out, because ImageParticle is on the GameArea
- system: gameCanvas.ps
- group: "green"
- Timer {
- id: arcadeTimer
- interval: Settings.menuDelay
- running : false
- repeat : false
- onTriggered: Logic.startNewGame(gameCanvas)
- }
- }
-
- Button {
- width: root.width
- rotatedButton: true
- imgSrc: "content/gfx/but-game-2.png"
- onClicked: {
- if (root.state == "in-game")
- return
- root.state = "in-game"
- gameCanvas.blockFile = "Block.qml"
- gameCanvas.background = "gfx/background.png"
- twopTimer.start();
- }
- system: gameCanvas.ps
- group: "green"
- Timer {
- id: twopTimer
- interval: Settings.menuDelay
- running : false
- repeat : false
- onTriggered: Logic.startNewGame(gameCanvas, "multiplayer")
- }
- }
-
- Button {
- width: root.width
- rotatedButton: true
- imgSrc: "content/gfx/but-game-3.png"
- onClicked: {
- if (root.state == "in-game")
- return
- root.state = "in-game"
- gameCanvas.blockFile = "SimpleBlock.qml"
- gameCanvas.background = "gfx/background.png"
- endlessTimer.start();
- }
- system: gameCanvas.ps
- group: "blue"
- Timer {
- id: endlessTimer
- interval: Settings.menuDelay
- running : false
- repeat : false
- onTriggered: Logic.startNewGame(gameCanvas, "endless")
- }
- }
-
- Button {
- width: root.width
- rotatedButton: true
- imgSrc: "content/gfx/but-game-4.png"
- group: "yellow"
- onClicked: {
- if (root.state == "in-game")
- return
- root.state = "in-game"
- gameCanvas.blockFile = "PuzzleBlock.qml"
- gameCanvas.background = "gfx/background.png"
- puzzleTimer.start();
- }
- Timer {
- id: puzzleTimer
- interval: Settings.menuDelay
- running : false
- repeat : false
- onTriggered: loadPuzzle();
- }
- system: gameCanvas.ps
- }
- }
- }
-
- Image {
- id: scoreBar
- source: "content/gfx/bar.png"
- width: parent.width
- z: 6
- y: -Settings.headerHeight
- height: Settings.headerHeight
- Behavior on opacity { NumberAnimation {} }
- SamegameText {
- id: arcadeScore
- anchors { right: parent.right; topMargin: 3; rightMargin: 11; top: parent.top}
- text: '<font color="#f7d303">P1:</font> ' + gameCanvas.score
- font.pixelSize: Settings.fontPixelSize
- textFormat: Text.StyledText
- color: "white"
- opacity: gameCanvas.mode == "arcade" ? 1 : 0
- Behavior on opacity { NumberAnimation {} }
- }
- SamegameText {
- id: arcadeHighScore
- anchors { left: parent.left; topMargin: 3; leftMargin: 11; top: parent.top}
- text: '<font color="#f7d303">Highscore:</font> ' + gameCanvas.highScore
- opacity: gameCanvas.mode == "arcade" ? 1 : 0
- }
- SamegameText {
- id: p1Score
- anchors { right: parent.right; topMargin: 3; rightMargin: 11; top: parent.top}
- text: '<font color="#f7d303">P1:</font> ' + gameCanvas.score
- opacity: gameCanvas.mode == "multiplayer" ? 1 : 0
- }
- SamegameText {
- id: p2Score
- anchors { left: parent.left; topMargin: 3; leftMargin: 11; top: parent.top}
- text: '<font color="#f7d303">P2:</font> ' + gameCanvas.score2
- opacity: gameCanvas.mode == "multiplayer" ? 1 : 0
- rotation: 180
- }
- SamegameText {
- id: puzzleMoves
- anchors { left: parent.left; topMargin: 3; leftMargin: 11; top: parent.top}
- text: '<font color="#f7d303">Moves:</font> ' + gameCanvas.moves
- opacity: gameCanvas.mode == "puzzle" ? 1 : 0
- }
- SamegameText {
- Image {
- source: "content/gfx/icon-time.png"
- x: -20
- }
- id: puzzleTime
- anchors { topMargin: 3; top: parent.top; horizontalCenter: parent.horizontalCenter; horizontalCenterOffset: 20}
- text: "00:00"
- opacity: gameCanvas.mode == "puzzle" ? 1 : 0
- Timer {
- interval: 1000
- repeat: true
- running: gameCanvas.mode == "puzzle" && !gameCanvas.gameOver
- onTriggered: {
- var elapsed = Math.floor((new Date() - Logic.gameDuration)/ 1000.0);
- var mins = Math.floor(elapsed/60.0);
- var secs = (elapsed % 60);
- puzzleTime.text = (mins < 10 ? "0" : "") + mins + ":" + (secs < 10 ? "0" : "") + secs;
- }
- }
- }
- SamegameText {
- id: puzzleScore
- anchors { right: parent.right; topMargin: 3; rightMargin: 11; top: parent.top}
- text: '<font color="#f7d303">Score:</font> ' + gameCanvas.score
- opacity: gameCanvas.mode == "puzzle" ? 1 : 0
- }
- }
-
- Image {
- id: bottomBar
- width: parent.width
- height: Settings.footerHeight
- source: "content/gfx/bar.png"
- y: parent.height - Settings.footerHeight;
- z: 2
- Button {
- id: quitButton
- height: Settings.toolButtonHeight
- imgSrc: "content/gfx/but-quit.png"
- onClicked: {Qt.quit(); }
- anchors { left: parent.left; verticalCenter: parent.verticalCenter; leftMargin: 11 }
- }
- Button {
- id: menuButton
- height: Settings.toolButtonHeight
- imgSrc: "content/gfx/but-menu.png"
- visible: (root.state == "in-game");
- onClicked: {root.state = ""; Logic.cleanUp(); gameCanvas.mode = ""}
- anchors { left: quitButton.right; verticalCenter: parent.verticalCenter; leftMargin: 0 }
- }
- Button {
- id: againButton
- height: Settings.toolButtonHeight
- imgSrc: "content/gfx/but-game-new.png"
- visible: (root.state == "in-game");
- opacity: gameCanvas.gameOver && (gameCanvas.mode == "arcade" || gameCanvas.mode == "multiplayer")
- Behavior on opacity{ NumberAnimation {} }
- onClicked: {if (gameCanvas.gameOver) { Logic.startNewGame(gameCanvas, gameCanvas.mode);}}
- anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 11 }
- }
- Button {
- id: nextButton
- height: Settings.toolButtonHeight
- imgSrc: "content/gfx/but-puzzle-next.png"
- visible: (root.state == "in-game") && gameCanvas.mode == "puzzle" && gameCanvas.puzzleWon
- opacity: gameCanvas.puzzleWon ? 1 : 0
- Behavior on opacity{ NumberAnimation {} }
- onClicked: {if (gameCanvas.puzzleWon) nextPuzzle();}
- anchors { right: parent.right; verticalCenter: parent.verticalCenter; rightMargin: 11 }
- }
- }
-
- Connections {
- target: root
- onStateChanged: stateChangeAnim.running = true
- }
- SequentialAnimation {
- id: stateChangeAnim
- ParallelAnimation {
- NumberAnimation { target: bottomBar; property: "y"; to: root.height; duration: Settings.menuDelay/2; easing.type: Easing.OutQuad }
- NumberAnimation { target: scoreBar; property: "y"; to: -Settings.headerHeight; duration: Settings.menuDelay/2; easing.type: Easing.OutQuad }
- }
- ParallelAnimation {
- NumberAnimation { target: bottomBar; property: "y"; to: root.height - Settings.footerHeight; duration: Settings.menuDelay/2; easing.type: Easing.OutBounce}
- NumberAnimation { target: scoreBar; property: "y"; to: root.state == "" ? -Settings.headerHeight : 0; duration: Settings.menuDelay/2; easing.type: Easing.OutBounce}
- }
- }
-
- states: [
- State {
- name: "in-game"
- PropertyChanges {
- target: menu
- opacity: 0
- visible: false
- }
- }
- ]
-
- transitions: [
- Transition {
- NumberAnimation {properties: "x,y,opacity"}
- }
- ]
-
- //"Debug mode"
- focus: true
- Keys.onAsteriskPressed: Logic.nuke();
- Keys.onSpacePressed: gameCanvas.puzzleWon = true;
-}
diff --git a/examples/quick/demos/samegame/samegame.qmlproject b/examples/quick/demos/samegame/samegame.qmlproject
deleted file mode 100644
index 42ffacf4f8..0000000000
--- a/examples/quick/demos/samegame/samegame.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.1
-
-Project {
- mainFile: "samegame.qml"
-
- /* Include .qml, .js, and image files from current directory and subdirectories */
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-}
diff --git a/examples/quick/demos/samegame/samegame.qrc b/examples/quick/demos/samegame/samegame.qrc
deleted file mode 100644
index 348ee109f9..0000000000
--- a/examples/quick/demos/samegame/samegame.qrc
+++ /dev/null
@@ -1,73 +0,0 @@
-<RCC>
- <qresource prefix="/demos/samegame">
- <file>samegame.qml</file>
- <file>content/qmldir</file>
- <file>content/Settings.qml</file>
- <file>content/gfx/text-p1-won.png</file>
- <file>content/gfx/background-puzzle.png</file>
- <file>content/gfx/background.png</file>
- <file>content/gfx/bar.png</file>
- <file>content/gfx/blue-puzzle.png</file>
- <file>content/gfx/blue.png</file>
- <file>content/gfx/bubble-highscore.png</file>
- <file>content/gfx/bubble-puzzle.png</file>
- <file>content/gfx/but-game-1.png</file>
- <file>content/gfx/but-game-2.png</file>
- <file>content/gfx/but-game-3.png</file>
- <file>content/gfx/but-game-4.png</file>
- <file>content/gfx/but-game-new.png</file>
- <file>content/gfx/but-menu.png</file>
- <file>content/gfx/but-puzzle-next.png</file>
- <file>content/gfx/but-quit.png</file>
- <file>content/gfx/green-puzzle.png</file>
- <file>content/gfx/green.png</file>
- <file>content/gfx/icon-fail.png</file>
- <file>content/gfx/icon-ok.png</file>
- <file>content/gfx/icon-time.png</file>
- <file>content/gfx/logo-a.png</file>
- <file>content/gfx/logo-e.png</file>
- <file>content/gfx/logo-g.png</file>
- <file>content/gfx/logo-m.png</file>
- <file>content/gfx/logo-s.png</file>
- <file>content/gfx/logo.png</file>
- <file>content/gfx/particle-brick.png</file>
- <file>content/gfx/particle-paint.png</file>
- <file>content/gfx/particle-smoke.png</file>
- <file>content/gfx/red-puzzle.png</file>
- <file>content/gfx/red.png</file>
- <file>content/gfx/text-highscore-new.png</file>
- <file>content/gfx/text-highscore.png</file>
- <file>content/gfx/text-no-winner.png</file>
- <file>content/gfx/text-p1-go.png</file>
- <file>content/gfx/text-p1.png</file>
- <file>content/gfx/text-p2-go.png</file>
- <file>content/gfx/text-p2-won.png</file>
- <file>content/gfx/text-p2.png</file>
- <file>content/gfx/yellow-puzzle.png</file>
- <file>content/gfx/yellow.png</file>
- <file>content/levels/level0.qml</file>
- <file>content/levels/level1.qml</file>
- <file>content/levels/level2.qml</file>
- <file>content/levels/level3.qml</file>
- <file>content/levels/level4.qml</file>
- <file>content/levels/level5.qml</file>
- <file>content/levels/level6.qml</file>
- <file>content/levels/level7.qml</file>
- <file>content/levels/level8.qml</file>
- <file>content/levels/level9.qml</file>
- <file>content/levels/TemplateBase.qml</file>
- <file>content/SamegameText.qml</file>
- <file>content/SimpleBlock.qml</file>
- <file>content/Block.qml</file>
- <file>content/BlockEmitter.qml</file>
- <file>content/Button.qml</file>
- <file>content/GameArea.qml</file>
- <file>content/LogoAnimation.qml</file>
- <file>content/MenuEmitter.qml</file>
- <file>content/PaintEmitter.qml</file>
- <file>content/PrimaryPack.qml</file>
- <file>content/PuzzleBlock.qml</file>
- <file>content/samegame.js</file>
- <file>content/SmokeText.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/demos/stocqt/content/+windows/Settings.qml b/examples/quick/demos/stocqt/content/+windows/Settings.qml
deleted file mode 100644
index 137ec546cc..0000000000
--- a/examples/quick/demos/stocqt/content/+windows/Settings.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-pragma Singleton
-import QtQml 2.0
-
-QtObject {
- property string fontFamily: "Arial"
-}
diff --git a/examples/quick/demos/stocqt/content/Banner.qml b/examples/quick/demos/stocqt/content/Banner.qml
deleted file mode 100644
index bcba122043..0000000000
--- a/examples/quick/demos/stocqt/content/Banner.qml
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Layouts 1.1
-
-Rectangle {
- id: banner
- height: 80
- color: "#000000"
-
- GridLayout {
- anchors.fill: parent
- rows: 1
- columns: 3
- Rectangle {
- Layout.leftMargin: 10
- Layout.topMargin: 20
- Layout.alignment: Qt.AlignLeft | Qt.AlignTop
- Image {
- id: arrow
- source: "./images/icon-left-arrow.png"
- visible: root.currentIndex == 1 ? true : false
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.currentIndex = 0;
- }
- }
- }
- Text {
- id: stocText
- color: "#ffffff"
- font.family: "Abel"
- font.pointSize: 40
- text: "Stoc"
- Layout.alignment: Qt.AlignRight
- Layout.leftMargin: parent.width / 2.5
- }
- Text {
- id: qtText
- color: "#5caa15"
- font.family: "Abel"
- font.pointSize: 40
- text: "Qt"
- Layout.fillWidth: true
- }
- }
-}
diff --git a/examples/quick/demos/stocqt/content/Button.qml b/examples/quick/demos/stocqt/content/Button.qml
deleted file mode 100644
index ed9b4ed491..0000000000
--- a/examples/quick/demos/stocqt/content/Button.qml
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "."
-
-Rectangle {
- id: button
- signal clicked
- property alias text: txt.text
- property bool buttonEnabled: false
- width: Math.max(64, txt.width + 16)
- height: 32
- color: "transparent"
- MouseArea {
- anchors.fill: parent
- onClicked: button.clicked()
- }
- Text {
- anchors.centerIn: parent
- font.family: Settings.fontFamily
- font.pointSize: 19
- font.weight: Font.DemiBold
- color: button.buttonEnabled ? "#000000" : "#14aaff"
- id: txt
- }
-}
diff --git a/examples/quick/demos/stocqt/content/CheckBox.qml b/examples/quick/demos/stocqt/content/CheckBox.qml
deleted file mode 100644
index 9f9138963b..0000000000
--- a/examples/quick/demos/stocqt/content/CheckBox.qml
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Research In Motion.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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: button
- property bool buttonEnabled: true
- width: 30
- height: 30
- x: 5
- MouseArea {
- id: mouse
- anchors.fill: parent
- onClicked: {
- if (buttonEnabled)
- buttonEnabled = false;
- else
- buttonEnabled = true;
- }
- }
- Rectangle {
- id: checkbox
- width: 30
- height: 30
- border.color: "#999999"
- border.width: 1
- antialiasing: true
- radius: 2
- color: "transparent"
- Rectangle {
- anchors.fill: parent
- anchors.margins: 5
- antialiasing: true
- radius: 1
- color: mouse.pressed || buttonEnabled ? "#999999" : "transparent"
- }
- }
-}
diff --git a/examples/quick/demos/stocqt/content/Settings.qml b/examples/quick/demos/stocqt/content/Settings.qml
deleted file mode 100644
index 9c7c59ed70..0000000000
--- a/examples/quick/demos/stocqt/content/Settings.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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$
-**
-****************************************************************************/
-
-pragma Singleton
-import QtQml 2.0
-
-QtObject {
- property string fontFamily: "Open Sans"
-}
diff --git a/examples/quick/demos/stocqt/content/StockChart.qml b/examples/quick/demos/stocqt/content/StockChart.qml
deleted file mode 100644
index 0af06a8d54..0000000000
--- a/examples/quick/demos/stocqt/content/StockChart.qml
+++ /dev/null
@@ -1,400 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Layouts 1.1
-import "."
-
-Rectangle {
- id: chart
-
- property var stockModel: null
- property var startDate: new Date()
- property var endDate: new Date()
- property string activeChart: "week"
- property var settings
- property int gridSize: 4
- property real gridStep: gridSize ? (canvas.width - canvas.tickMargin) / gridSize : canvas.xGridStep
-
- function update() {
- endDate = new Date(stockModel.newest);
- if (chart.activeChart === "month") {
- chart.startDate = new Date(stockModel.newest.getFullYear(),
- stockModel.newest.getMonth() - 1,
- stockModel.newest.getDate());
- gridSize = 4;
- }
- else if (chart.activeChart === "quarter") {
- chart.startDate = new Date(stockModel.newest.getFullYear(),
- stockModel.newest.getMonth() - 3,
- stockModel.newest.getDate());
- gridSize = 3;
- }
- else if (chart.activeChart === "halfyear") {
- chart.startDate = new Date(stockModel.newest.getFullYear(),
- stockModel.newest.getMonth() - 6,
- stockModel.newest.getDate());
- gridSize = 6;
- }
- else {
- chart.startDate = new Date(stockModel.newest.getFullYear(),
- stockModel.newest.getMonth(),
- stockModel.newest.getDate() - 7);
- gridSize = 0;
- }
-
- canvas.requestPaint();
- }
-
- GridLayout {
- anchors.fill: parent
- columns: 6
- rows: 3
- columnSpacing: 4
- Button {
- id: weekButton
- text: "Week"
- buttonEnabled: chart.activeChart === "week"
- onClicked: {
- chart.activeChart = "week";
- chart.update();
- }
- }
-
- Button {
- id: monthButton
- text: "Month"
- buttonEnabled: chart.activeChart === "month"
- onClicked: {
- chart.activeChart = "month";
- chart.update();
- }
- }
-
- Button {
- id: quarterlyButton
- text: "3 Months"
- buttonEnabled: chart.activeChart === "quarter"
- onClicked: {
- chart.activeChart = "quarter";
- chart.update();
- }
- }
-
- Button {
- id: halfYearlyButton
- text: "6 Months"
- buttonEnabled: chart.activeChart === "halfyear"
- onClicked: {
- chart.activeChart = "halfyear";
- chart.update();
- }
- }
-
- Canvas {
- id: canvas
- Layout.fillWidth: true
- Layout.fillHeight: true
- Layout.columnSpan: 6
- // Uncomment below lines to use OpenGL hardware accelerated rendering.
- // See Canvas documentation for available options.
- // renderTarget: Canvas.FramebufferObject
- // renderStrategy: Canvas.Threaded
-
- property int pixelSkip: 1
- property int numPoints: 1
- property int tickMargin: 34
-
- property real xGridStep: (canvas.width - tickMargin) / numPoints
- property real yGridOffset: canvas.height / 26
- property real yGridStep: canvas.height / 12
-
- function drawBackground(ctx) {
- ctx.save();
- ctx.fillStyle = "#ffffff";
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- ctx.strokeStyle = "#d7d7d7";
- ctx.beginPath();
- // Horizontal grid lines
- for (var i = 0; i < 12; i++) {
- ctx.moveTo(0, canvas.yGridOffset + i * canvas.yGridStep);
- ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep);
- }
-
- // Vertical grid lines
- var height = 35 * canvas.height / 36;
- var yOffset = canvas.height - height;
- var xOffset = 0;
- for (i = 0; i < chart.gridSize; i++) {
- ctx.moveTo(xOffset + i * chart.gridStep, yOffset);
- ctx.lineTo(xOffset + i * chart.gridStep, height);
- }
- ctx.stroke();
-
- // Right ticks
- ctx.strokeStyle = "#666666";
- ctx.beginPath();
- var xStart = canvas.width - tickMargin;
- ctx.moveTo(xStart, 0);
- ctx.lineTo(xStart, canvas.height);
- for (i = 0; i < 12; i++) {
- ctx.moveTo(xStart, canvas.yGridOffset + i * canvas.yGridStep);
- ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep);
- }
- ctx.moveTo(0, canvas.yGridOffset + 9 * canvas.yGridStep);
- ctx.lineTo(canvas.width, canvas.yGridOffset + 9 * canvas.yGridStep);
- ctx.closePath();
- ctx.stroke();
-
- ctx.restore();
- }
-
- // Returns a shortened, readable version of the potentially
- // large volume number.
- function volumeToString(value) {
- if (value < 1000)
- return value;
- var exponent = parseInt(Math.log(value) / Math.log(1000));
- var shortVal = parseFloat(parseFloat(value) / Math.pow(1000, exponent)).toFixed(1);
-
- // Drop the decimal point on 3-digit values to make it fit
- if (shortVal >= 100.0) {
- shortVal = parseFloat(shortVal).toFixed(0);
- }
- return shortVal + "KMBTG".charAt(exponent - 1);
- }
-
- function drawScales(ctx, high, low, vol)
- {
- ctx.save();
- ctx.strokeStyle = "#888888";
- ctx.font = "10px Open Sans"
-
- ctx.beginPath();
-
- // prices on y-axis
- var x = canvas.width - tickMargin + 3;
- var priceStep = (high - low) / 9.0;
- for (var i = 0; i < 10; i += 2) {
- var price = parseFloat(high - i * priceStep).toFixed(1);
- ctx.text(price, x, canvas.yGridOffset + i * yGridStep - 2);
- }
-
- // volume scale
- for (i = 0; i < 3; i++) {
- var volume = volumeToString(vol - (i * (vol/3)));
- ctx.text(volume, x, canvas.yGridOffset + (i + 9) * yGridStep + 10);
- }
-
- ctx.closePath();
- ctx.stroke();
- ctx.restore();
- }
-
- function drawPrice(ctx, from, to, color, price, points, highest, lowest)
- {
- ctx.save();
- ctx.globalAlpha = 0.7;
- ctx.strokeStyle = color;
-
- ctx.lineWidth = numPoints > 200 ? 1 : 3
-
- ctx.beginPath();
-
- var end = points.length;
-
- var range = highest - lowest;
- if (range == 0) {
- range = 1;
- }
-
- for (var i = 0; i < end; i += pixelSkip) {
- var x = points[i].x;
- var y = points[i][price];
- var h = 9 * yGridStep;
-
- y = h * (lowest - y)/range + h + yGridOffset;
-
- if (i == 0) {
- ctx.moveTo(x, y);
- } else {
- ctx.lineTo(x, y);
- }
- }
- ctx.stroke();
- ctx.restore();
- }
-
- function drawVolume(ctx, from, to, color, price, points, highest)
- {
- ctx.save();
- ctx.fillStyle = color;
- ctx.globalAlpha = 0.8;
- ctx.lineWidth = 0;
- ctx.beginPath();
-
- var end = points.length;
- var margin = 0;
-
- if (chart.activeChart === "month" || chart.activeChart === "week") {
- margin = 8;
- ctx.shadowOffsetX = 4;
- ctx.shadowBlur = 3.5;
- ctx.shadowColor = Qt.darker(color);
- }
-
- // To match the volume graph with price grid, skip drawing the initial
- // volume of the first day on chart.
- for (var i = 1; i < end; i += pixelSkip) {
- var x = points[i - 1].x;
- var y = points[i][price];
- y = canvas.height * (y / highest);
- y = 3 * y / 12;
- ctx.fillRect(x, canvas.height - y + yGridOffset,
- canvas.xGridStep - margin, y);
- }
-
- ctx.stroke();
- ctx.restore();
- }
-
- function drawError(ctx, msg)
- {
- ctx.save();
- ctx.strokeStyle = "#888888";
- ctx.font = "24px Open Sans"
- ctx.textAlign = "center"
- ctx.shadowOffsetX = 4;
- ctx.shadowOffsetY = 4;
- ctx.shadowBlur = 1.5;
- ctx.shadowColor = "#aaaaaa";
- ctx.beginPath();
-
- ctx.fillText(msg, (canvas.width - tickMargin) / 2,
- (canvas.height - yGridOffset - yGridStep) / 2);
-
- ctx.closePath();
- ctx.stroke();
- ctx.restore();
- }
-
- onPaint: {
- numPoints = stockModel.indexOf(chart.startDate);
- if (chart.gridSize == 0)
- chart.gridSize = numPoints
-
- var ctx = canvas.getContext("2d");
- ctx.globalCompositeOperation = "source-over";
- ctx.lineWidth = 1;
-
- drawBackground(ctx);
-
- if (!stockModel.ready) {
- drawError(ctx, "No data available.");
- return;
- }
-
- var highestPrice = 0;
- var highestVolume = 0;
- var lowestPrice = -1;
- var points = [];
- for (var i = numPoints, j = 0; i >= 0 ; i -= pixelSkip, j += pixelSkip) {
- var price = stockModel.get(i);
- if (parseFloat(highestPrice) < parseFloat(price.high))
- highestPrice = price.high;
- if (parseInt(highestVolume, 10) < parseInt(price.volume, 10))
- highestVolume = price.volume;
- if (lowestPrice < 0 || parseFloat(lowestPrice) > parseFloat(price.low))
- lowestPrice = price.low;
- points.push({
- x: j * xGridStep,
- open: price.open,
- close: price.close,
- high: price.high,
- low: price.low,
- volume: price.volume
- });
- }
-
- if (settings.drawHighPrice)
- drawPrice(ctx, 0, numPoints, settings.highColor, "high", points, highestPrice, lowestPrice);
- if (settings.drawLowPrice)
- drawPrice(ctx, 0, numPoints, settings.lowColor, "low", points, highestPrice, lowestPrice);
- if (settings.drawOpenPrice)
- drawPrice(ctx, 0, numPoints,settings.openColor, "open", points, highestPrice, lowestPrice);
- if (settings.drawClosePrice)
- drawPrice(ctx, 0, numPoints, settings.closeColor, "close", points, highestPrice, lowestPrice);
-
- drawVolume(ctx, 0, numPoints, settings.volumeColor, "volume", points, highestVolume);
- drawScales(ctx, highestPrice, lowestPrice, highestVolume);
- }
- }
-
-
- Text {
- id: fromDate
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 8
- Layout.alignment: Qt.AlignLeft
- text: "| " + startDate.toDateString()
- }
- Text {
- id: toDate
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 8
- Layout.alignment: Qt.AlignRight
- Layout.rightMargin: canvas.tickMargin
- Layout.columnSpan: 5
- text: endDate.toDateString() + " |"
- }
- }
-}
diff --git a/examples/quick/demos/stocqt/content/StockInfo.qml b/examples/quick/demos/stocqt/content/StockInfo.qml
deleted file mode 100644
index e18f34e83c..0000000000
--- a/examples/quick/demos/stocqt/content/StockInfo.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 QtQuick.Layouts 1.1
-import "."
-
-Rectangle {
- id: root
- color: "transparent"
-
- property var stock: null
-
- GridLayout {
- id: stockInfoLayout
- anchors.fill: parent
- columns: 2
- rows: 3
- rowSpacing: 4
-
- Text {
- id: stockIdText
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 28
- font.weight: Font.DemiBold
- text: root.stock.stockId
- Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
- Layout.leftMargin: 10
- }
-
- Text {
- id: price
- color: "#6d6d6d"
- font.family: Settings.fontFamily
- font.pointSize: 28
- font.weight: Font.DemiBold
- text: parseFloat(root.stock.stockPrice).toFixed(2);
- Layout.fillWidth: true
- Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
- Layout.leftMargin: 5
- }
-
- Text {
- id: stockNameText
- color: "#0c0c0c"
- font.family: Settings.fontFamily
- font.pointSize: 16
- elide: Text.ElideRight
- maximumLineCount: 3
- wrapMode: Text.WordWrap
- text: root.stock.stockName
- Layout.leftMargin: 10
- Layout.columnSpan: 2
- Layout.alignment: Qt.AlignLeft
- }
-
-
- Text {
- id: priceChange
- Layout.alignment: Qt.AlignLeft | Qt.AlignTop
- Layout.leftMargin: 10
- color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 18
- text: parseFloat(root.stock.stockPriceChanged).toFixed(2);
- }
-
- Text {
- id: priceChangePercentage
- Layout.alignment: Qt.AlignLeft | Qt.AlignTop
- color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 18
- font.weight: Font.DemiBold
- Layout.fillWidth: true
- text: "(" +
- parseFloat(root.stock.stockPriceChanged /
- (root.stock.stockPrice - root.stock.stockPriceChanged) * 100.0).toFixed(2) +
- "%)"
- }
- }
-}
diff --git a/examples/quick/demos/stocqt/content/StockListDelegate.qml b/examples/quick/demos/stocqt/content/StockListDelegate.qml
deleted file mode 100644
index 8a4a8f6922..0000000000
--- a/examples/quick/demos/stocqt/content/StockListDelegate.qml
+++ /dev/null
@@ -1,163 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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.5
-import QtQuick.Layouts 1.1
-import "."
-
-Rectangle {
- height: 102
- width: parent.width
- color: "transparent"
- MouseArea {
- anchors.fill: parent;
- onClicked: {
- if (view.currentIndex == index)
- mainRect.currentIndex = 1;
- else
- view.currentIndex = index;
- }
- }
- GridLayout {
- id: stockGrid
- columns: 3
- rows: 2
- anchors.fill: parent
-
- Text {
- id: stockIdText
- Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
- Layout.leftMargin: 10
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 20
- font.weight: Font.Bold
- verticalAlignment: Text.AlignVCenter
- text: stockId
- }
-
- Text {
- id: stockValueText
- Layout.preferredWidth: 100
- Layout.alignment: Qt.AlignRight | Qt.AlignBottom
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 20
- font.bold: true
- horizontalAlignment: Text.AlignRight
- verticalAlignment: Text.AlignVCenter
- text: value
- }
- Text {
- id: stockValueChangeText
- Layout.preferredWidth: 135
- Layout.rightMargin: 10
- Layout.alignment: Qt.AlignRight | Qt.AlignBottom
- color: "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 20
- font.bold: true
- horizontalAlignment: Text.AlignRight
- verticalAlignment: Text.AlignVCenter
- text: change
- onTextChanged: {
- if (parseFloat(text) >= 0.0)
- color = "#328930";
- else
- color = "#d40000";
- }
- }
- Text {
- id: stockNameText
- Layout.preferredWidth: 300
- Layout.leftMargin: 10
- Layout.alignment: Qt.AlignLeft | Qt.AlignTop
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 16
- font.bold: false
- elide: Text.ElideRight
- maximumLineCount: 1
- verticalAlignment: Text.AlignVCenter
- text: name
- }
-
- Item {Layout.fillWidth: true }
-
- Text {
- id: stockValueChangePercentageText
- Layout.fillWidth: true
- Layout.alignment: Qt.AlignRight | Qt.AlignTop
- Layout.rightMargin: 10
- color: "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 18
- font.bold: false
- horizontalAlignment: Text.AlignRight
- verticalAlignment: Text.AlignVCenter
- text: changePercentage
- onTextChanged: {
- if (parseFloat(text) >= 0.0)
- color = "#328930";
- else
- color = "#d40000";
- }
- }
- }
-
- Rectangle {
- id: endingLine
- anchors.top: stockGrid.bottom
- height: 1
- width: parent.width
- color: "#d7d7d7"
- }
-}
-
diff --git a/examples/quick/demos/stocqt/content/StockListModel.qml b/examples/quick/demos/stocqt/content/StockListModel.qml
deleted file mode 100644
index 2f697f5644..0000000000
--- a/examples/quick/demos/stocqt/content/StockListModel.qml
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-ListModel {
- id: stocks
-
- // pre-fetch data for all entries
- Component.onCompleted: {
- for (var idx = 0; idx < count; ++idx) {
- getCloseValue(idx)
- }
- }
-
- function getCloseValue(index) {
-
- var endDate = new Date(); // today
- var startDate = new Date();
- endDate.setDate(startDate.getDate() - 1);
- startDate.setDate(endDate.getDate() - 7);
-
- var req = "data/" + get(index).stockId + ".csv"
-
- var xhr = new XMLHttpRequest;
-
- xhr.open("GET", req, true);
-
- xhr.onreadystatechange = function() {
- if (xhr.readyState === XMLHttpRequest.LOADING || xhr.readyState === XMLHttpRequest.DONE) {
- var records = xhr.responseText.split('\n');
- var unknown = "n/a";
- set(index, {"value": unknown, "change": unknown, "changePercentage": unknown});
- if (records.length > 0 && xhr.status == 200) {
- var r = records[1].split(',');
- var today = parseFloat(r[4]);
-
- if (!isNaN(today))
- setProperty(index, "value", today.toFixed(2));
- if (records.length > 2) {
- r = records[2].split(',');
- var yesterday = parseFloat(r[4]);
- var change = today - yesterday;
-
- if (change >= 0.0)
- setProperty(index, "change", "+" + change.toFixed(2));
- else
- setProperty(index, "change", change.toFixed(2));
-
- var changePercentage = (change / yesterday) * 100.0;
- if (changePercentage >= 0.0)
- setProperty(index, "changePercentage", "+" + changePercentage.toFixed(2) + "%");
- else
- setProperty(index, "changePercentage", changePercentage.toFixed(2) + "%");
- }
- }
- }
- }
- xhr.send()
- }
- // Uncomment to test invalid entries
- // ListElement {name: "The Qt Company"; stockId: "TQTC"; value: "999.0"; change: "0.0"; changePercentage: "0.0"}
-
- // Offline data downloaded using the url, https://www.quandl.com/api/v3/datasets/WIKI/<stockId>.csv.
- ListElement {name: "Advanced Micro Devices Inc."; stockId: "AMD"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Amazon.com Inc."; stockId: "AMZN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Apple Inc."; stockId: "AAPL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Autodesk Inc."; stockId: "ADSK"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Cisco Systems Inc."; stockId: "CSCO"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "eBay Inc."; stockId: "EBAY"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Electronic Arts Inc."; stockId: "EA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Intel Corp."; stockId: "INTC"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Microsoft Corp."; stockId: "MSFT"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "NetApp Inc."; stockId: "NTAP"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Netflix Inc."; stockId: "NFLX"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Norwegian Cruise Line Holdings Ltd."; stockId: "NCLH"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "NVIDIA Corp."; stockId: "NVDA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "PayPal Holdings Inc."; stockId: "PYPL"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "QUALCOMM Inc."; stockId: "QCOM"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Tesla Motors Inc."; stockId: "TSLA"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Texas Instruments Inc."; stockId: "TXN"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
- ListElement {name: "Facebook Inc."; stockId: "FB"; value: "0.0"; change: "0.0"; changePercentage: "0.0"}
-}
-
diff --git a/examples/quick/demos/stocqt/content/StockListView.qml b/examples/quick/demos/stocqt/content/StockListView.qml
deleted file mode 100644
index e30355c675..0000000000
--- a/examples/quick/demos/stocqt/content/StockListView.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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 "."
-
-Rectangle {
- id: root
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- color: "white"
-
- property string currentStockId: ""
- property string currentStockName: ""
-
- ListView {
- id: view
- anchors.fill: parent
- clip: true
- keyNavigationWraps: true
- highlightMoveDuration: 0
- focus: true
- snapMode: ListView.SnapToItem
- model: StockListModel {}
- currentIndex: -1 // Don't pre-select any item
-
- onCurrentIndexChanged: {
- if (currentItem) {
- root.currentStockId = model.get(currentIndex).stockId;
- root.currentStockName = model.get(currentIndex).name;
- }
- }
-
- delegate: StockListDelegate {}
-
- highlight: Rectangle {
- width: view.width
- color: "#eeeeee"
- }
- }
-}
diff --git a/examples/quick/demos/stocqt/content/StockModel.qml b/examples/quick/demos/stocqt/content/StockModel.qml
deleted file mode 100644
index 9e3a815c11..0000000000
--- a/examples/quick/demos/stocqt/content/StockModel.qml
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, 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 The Qt Company Ltd 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
-
-ListModel {
- id: model
- property string stockId: ""
- property string stockName: ""
- property var newest
- property var oldest
- property bool ready: false
- property real stockPrice: 0.0
- property real stockPriceChanged: 0.0
-
- signal dataReady
-
- function indexOf(date) {
- if (model.count == 0)
- return -1;
-
- if (newest <= date)
- date = new Date(newest.getYear(),
- newest.getMonth(),
- newest.getDate() - 7);
-
- if (oldest >= date)
- return model.count - 1;
-
- var currDiff = 0;
- var bestDiff = Math.abs(date.getTime() - newest.getTime());
- var retval = 0;
- for (var i = 0; i < model.count; i++) {
- var d = new Date(model.get(i).date);
- currDiff = Math.abs(d.getTime() - date.getTime());
- if (currDiff < bestDiff) {
- bestDiff = currDiff;
- retval = i + 1;
- }
- if (currDiff > bestDiff)
- return retval;
- }
- return -1;
- }
-
- function createStockPrice(r) {
- return {
- "date": r[0],
- "open":r[1],
- "high":r[2],