From 27d22c5f4201c7555b42e187252bee3fd88d3821 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 13 Jun 2013 15:13:32 +0200 Subject: Doc: Move Qt Quick 1 demos and their documentation When installing the examples, we currently end up with a QT_INSTALL_EXAMPLES/demos directory with nothing but documentation files. This change moves the docs and also the demos themselves into examples/declarative/demos. Also fixes the links in demo .qdoc files. Task-number: QTBUG-31722 Change-Id: Ied15526be1db8437e14be786ea69eae98af8dd3f Reviewed-by: Jerome Pasion --- examples/declarative/calculator/calculator.desktop | 11 - examples/declarative/calculator/calculator.pro | 24 -- .../declarative/calculator/calculator.qmlproject | 16 -- examples/declarative/calculator/calculator.svg | 93 ------ examples/declarative/calculator/calculator64.png | Bin 3400 -> 0 bytes examples/declarative/calculator/calculator80.png | Bin 4945 -> 0 bytes .../calculator/calculator_harmattan.desktop | 11 - examples/declarative/calculator/main.cpp | 61 ---- .../qml/calculator/CalculatorCore/Button.qml | 80 ------ .../qml/calculator/CalculatorCore/Display.qml | 68 ----- .../qml/calculator/CalculatorCore/calculator.js | 91 ------ .../calculator/CalculatorCore/images/button-.png | Bin 1288 -> 0 bytes .../CalculatorCore/images/button-blue.png | Bin 1565 -> 0 bytes .../CalculatorCore/images/button-green.png | Bin 1543 -> 0 bytes .../CalculatorCore/images/button-purple.png | Bin 1566 -> 0 bytes .../CalculatorCore/images/button-red.png | Bin 1586 -> 0 bytes .../calculator/CalculatorCore/images/display.png | Bin 998 -> 0 bytes .../qml/calculator/CalculatorCore/qmldir | 2 - .../calculator/qml/calculator/calculator.qml | 162 ----------- examples/declarative/declarative.pro | 8 +- .../demos/calculator/calculator.desktop | 11 + .../declarative/demos/calculator/calculator.pro | 24 ++ .../demos/calculator/calculator.qmlproject | 16 ++ .../declarative/demos/calculator/calculator.svg | 93 ++++++ .../declarative/demos/calculator/calculator64.png | Bin 0 -> 3400 bytes .../declarative/demos/calculator/calculator80.png | Bin 0 -> 4945 bytes .../demos/calculator/calculator_harmattan.desktop | 11 + examples/declarative/demos/calculator/main.cpp | 61 ++++ .../qml/calculator/CalculatorCore/Button.qml | 80 ++++++ .../qml/calculator/CalculatorCore/Display.qml | 68 +++++ .../qml/calculator/CalculatorCore/calculator.js | 91 ++++++ .../calculator/CalculatorCore/images/button-.png | Bin 0 -> 1288 bytes .../CalculatorCore/images/button-blue.png | Bin 0 -> 1565 bytes .../CalculatorCore/images/button-green.png | Bin 0 -> 1543 bytes .../CalculatorCore/images/button-purple.png | Bin 0 -> 1566 bytes .../CalculatorCore/images/button-red.png | Bin 0 -> 1586 bytes .../calculator/CalculatorCore/images/display.png | Bin 0 -> 998 bytes .../qml/calculator/CalculatorCore/qmldir | 2 + .../demos/calculator/qml/calculator/calculator.qml | 162 +++++++++++ examples/declarative/demos/demos.pro | 10 + .../demos/doc/images/qml-calculator-example.png | Bin 0 -> 33892 bytes .../demos/doc/images/qml-minehunt-demo.png | Bin 0 -> 170648 bytes .../demos/doc/images/qml-photoviewer-demo.png | Bin 0 -> 473306 bytes .../demos/doc/images/qml-rssnews-demo.png | Bin 0 -> 128307 bytes .../demos/doc/images/qml-samegame-demo.png | Bin 0 -> 213137 bytes .../demos/doc/images/qml-snake-demo.png | Bin 0 -> 105053 bytes .../demos/doc/images/qml-twitter-demo.png | Bin 0 -> 95812 bytes .../declarative/demos/doc/src/qml-calculator.qdoc | 37 +++ .../declarative/demos/doc/src/qml-minehunt.qdoc | 38 +++ .../declarative/demos/doc/src/qml-photoviewer.qdoc | 37 +++ .../declarative/demos/doc/src/qml-rssnews.qdoc | 37 +++ .../declarative/demos/doc/src/qml-samegame.qdoc | 38 +++ examples/declarative/demos/doc/src/qml-snake.qdoc | 38 +++ .../declarative/demos/doc/src/qml-twitter.qdoc | 38 +++ examples/declarative/demos/minehunt/README | 6 + examples/declarative/demos/minehunt/main.cpp | 62 ++++ examples/declarative/demos/minehunt/minehunt.cpp | 221 ++++++++++++++ examples/declarative/demos/minehunt/minehunt.h | 129 +++++++++ examples/declarative/demos/minehunt/minehunt.pro | 25 ++ .../declarative/demos/minehunt/minehunt.qmlproject | 16 ++ examples/declarative/demos/minehunt/minehunt.qrc | 19 ++ .../qml/minehunt/MinehuntCore/Explosion.qml | 65 +++++ .../minehunt/qml/minehunt/MinehuntCore/Tile.qml | 128 +++++++++ .../qml/minehunt/MinehuntCore/pics/back.png | Bin 0 -> 558 bytes .../qml/minehunt/MinehuntCore/pics/background.png | Bin 0 -> 313930 bytes .../qml/minehunt/MinehuntCore/pics/bomb-color.png | Bin 0 -> 284 bytes .../qml/minehunt/MinehuntCore/pics/bomb.png | Bin 0 -> 535 bytes .../qml/minehunt/MinehuntCore/pics/face-sad.png | Bin 0 -> 14844 bytes .../minehunt/MinehuntCore/pics/face-smile-big.png | Bin 0 -> 13810 bytes .../qml/minehunt/MinehuntCore/pics/face-smile.png | Bin 0 -> 15408 bytes .../qml/minehunt/MinehuntCore/pics/flag-color.png | Bin 0 -> 219 bytes .../qml/minehunt/MinehuntCore/pics/flag.png | Bin 0 -> 196 bytes .../qml/minehunt/MinehuntCore/pics/front.png | Bin 0 -> 580 bytes .../qml/minehunt/MinehuntCore/pics/quit.png | Bin 0 -> 583 bytes .../qml/minehunt/MinehuntCore/pics/star.png | Bin 0 -> 2677 bytes .../demos/minehunt/qml/minehunt/minehunt.qml | 112 ++++++++ examples/declarative/demos/photoviewer/main.cpp | 55 ++++ .../demos/photoviewer/photoviewer.desktop | 11 + .../declarative/demos/photoviewer/photoviewer.pro | 24 ++ .../demos/photoviewer/photoviewer.qmlproject | 16 ++ .../declarative/demos/photoviewer/photoviewer.svg | 93 ++++++ .../demos/photoviewer/photoviewer64.png | Bin 0 -> 3400 bytes .../demos/photoviewer/photoviewer80.png | Bin 0 -> 4945 bytes .../photoviewer/photoviewer_harmattan.desktop | 11 + .../photoviewer/PhotoViewerCore/AlbumDelegate.qml | 146 ++++++++++ .../photoviewer/PhotoViewerCore/BusyIndicator.qml | 50 ++++ .../qml/photoviewer/PhotoViewerCore/Button.qml | 72 +++++ .../photoviewer/PhotoViewerCore/EditableButton.qml | 86 ++++++ .../photoviewer/PhotoViewerCore/PhotoDelegate.qml | 188 ++++++++++++ .../photoviewer/PhotoViewerCore/ProgressBar.qml | 57 ++++ .../qml/photoviewer/PhotoViewerCore/RssModel.qml | 54 ++++ .../qml/photoviewer/PhotoViewerCore/Tag.qml | 91 ++++++ .../PhotoViewerCore/images/box-shadow.png | Bin 0 -> 588 bytes .../photoviewer/PhotoViewerCore/images/busy.png | Bin 0 -> 2629 bytes .../PhotoViewerCore/images/cardboard.png | Bin 0 -> 8844 bytes .../qml/photoviewer/PhotoViewerCore/qmldir | 8 + .../photoviewer/PhotoViewerCore/script/script.js | 27 ++ .../demos/photoviewer/qml/photoviewer/i18n/base.ts | 30 ++ .../photoviewer/qml/photoviewer/i18n/qml_fr.qm | Bin 0 -> 268 bytes .../photoviewer/qml/photoviewer/i18n/qml_fr.ts | 30 ++ .../photoviewer/qml/photoviewer/photoviewer.qml | 110 +++++++ examples/declarative/demos/rssnews/main.cpp | 55 ++++ .../rssnews/qml/rssnews/content/BusyIndicator.qml | 53 ++++ .../qml/rssnews/content/CategoryDelegate.qml | 82 ++++++ .../rssnews/qml/rssnews/content/NewsDelegate.qml | 71 +++++ .../demos/rssnews/qml/rssnews/content/RssFeeds.qml | 59 ++++ .../rssnews/qml/rssnews/content/ScrollBar.qml | 107 +++++++ .../rssnews/qml/rssnews/content/images/busy.png | Bin 0 -> 2629 bytes .../qml/rssnews/content/images/scrollbar.png | Bin 0 -> 161 bytes .../demos/rssnews/qml/rssnews/rssnews.qml | 111 ++++++++ examples/declarative/demos/rssnews/rssnews.desktop | 11 + examples/declarative/demos/rssnews/rssnews.pro | 24 ++ .../declarative/demos/rssnews/rssnews.qmlproject | 16 ++ examples/declarative/demos/rssnews/rssnews.svg | 93 ++++++ examples/declarative/demos/rssnews/rssnews64.png | Bin 0 -> 3400 bytes examples/declarative/demos/rssnews/rssnews80.png | Bin 0 -> 4945 bytes .../demos/rssnews/rssnews_harmattan.desktop | 11 + examples/declarative/demos/samegame/main.cpp | 55 ++++ .../qml/samegame/SamegameCore/BoomBlock.qml | 109 +++++++ .../samegame/qml/samegame/SamegameCore/Button.qml | 75 +++++ .../samegame/qml/samegame/SamegameCore/Dialog.qml | 77 +++++ .../qml/samegame/SamegameCore/pics/background.png | Bin 0 -> 313930 bytes .../qml/samegame/SamegameCore/pics/blueStar.png | Bin 0 -> 278 bytes .../qml/samegame/SamegameCore/pics/blueStone.png | Bin 0 -> 3054 bytes .../qml/samegame/SamegameCore/pics/greenStar.png | Bin 0 -> 273 bytes .../qml/samegame/SamegameCore/pics/greenStone.png | Bin 0 -> 2932 bytes .../qml/samegame/SamegameCore/pics/redStar.png | Bin 0 -> 274 bytes .../qml/samegame/SamegameCore/pics/redStone.png | Bin 0 -> 2902 bytes .../qml/samegame/SamegameCore/pics/star.png | Bin 0 -> 262 bytes .../qml/samegame/SamegameCore/pics/yellowStone.png | Bin 0 -> 3056 bytes .../samegame/qml/samegame/SamegameCore/qmldir | 3 + .../samegame/qml/samegame/SamegameCore/samegame.js | 288 +++++++++++++++++++ .../demos/samegame/qml/samegame/highscores/README | 1 + .../qml/samegame/highscores/score_data.xml | 2 + .../qml/samegame/highscores/score_style.xsl | 28 ++ .../samegame/qml/samegame/highscores/scores.php | 34 +++ .../demos/samegame/qml/samegame/samegame.qml | 161 +++++++++++ .../declarative/demos/samegame/samegame.desktop | 11 + examples/declarative/demos/samegame/samegame.pro | 24 ++ .../declarative/demos/samegame/samegame.qmlproject | 16 ++ examples/declarative/demos/samegame/samegame.svg | 93 ++++++ examples/declarative/demos/samegame/samegame64.png | Bin 0 -> 3400 bytes examples/declarative/demos/samegame/samegame80.png | Bin 0 -> 4945 bytes .../demos/samegame/samegame_harmattan.desktop | 11 + examples/declarative/demos/snake/main.cpp | 55 ++++ .../demos/snake/qml/snake/content/Button.qml | 66 +++++ .../demos/snake/qml/snake/content/Cookie.qml | 93 ++++++ .../snake/qml/snake/content/HighScoreModel.qml | 139 +++++++++ .../demos/snake/qml/snake/content/Link.qml | 128 +++++++++ .../demos/snake/qml/snake/content/Skull.qml | 62 ++++ .../demos/snake/qml/snake/content/pics/README | 1 + .../snake/qml/snake/content/pics/background.png | Bin 0 -> 144508 bytes .../snake/qml/snake/content/pics/blueStar.png | Bin 0 -> 272 bytes .../snake/qml/snake/content/pics/blueStone.png | Bin 0 -> 3139 bytes .../demos/snake/qml/snake/content/pics/cookie.png | Bin 0 -> 2729 bytes .../demos/snake/qml/snake/content/pics/eyes.svg | 118 ++++++++ .../demos/snake/qml/snake/content/pics/head.png | Bin 0 -> 3473 bytes .../demos/snake/qml/snake/content/pics/head.svg | 134 +++++++++ .../demos/snake/qml/snake/content/pics/pause.png | Bin 0 -> 4327 bytes .../demos/snake/qml/snake/content/pics/redStar.png | Bin 0 -> 273 bytes .../snake/qml/snake/content/pics/redStone.png | Bin 0 -> 3456 bytes .../demos/snake/qml/snake/content/pics/skull.png | Bin 0 -> 2543 bytes .../demos/snake/qml/snake/content/pics/snake.jpg | Bin 0 -> 663901 bytes .../demos/snake/qml/snake/content/pics/star.png | Bin 0 -> 262 bytes .../snake/qml/snake/content/pics/stoneShadow.png | Bin 0 -> 1699 bytes .../snake/qml/snake/content/pics/yellowStar.png | Bin 0 -> 276 bytes .../snake/qml/snake/content/pics/yellowStone.png | Bin 0 -> 2667 bytes .../demos/snake/qml/snake/content/snake.js | 316 +++++++++++++++++++++ .../declarative/demos/snake/qml/snake/snake.qml | 272 ++++++++++++++++++ examples/declarative/demos/snake/snake.desktop | 11 + examples/declarative/demos/snake/snake.pro | 24 ++ examples/declarative/demos/snake/snake.qmlproject | 16 ++ examples/declarative/demos/snake/snake.svg | 93 ++++++ examples/declarative/demos/snake/snake64.png | Bin 0 -> 3400 bytes examples/declarative/demos/snake/snake80.png | Bin 0 -> 4945 bytes .../demos/snake/snake_harmattan.desktop | 11 + examples/declarative/demos/twitter/main.cpp | 55 ++++ .../twitter/qml/twitter/TwitterCore/Button.qml | 90 ++++++ .../qml/twitter/TwitterCore/FatDelegate.qml | 105 +++++++ .../twitter/qml/twitter/TwitterCore/Input.qml | 65 +++++ .../twitter/qml/twitter/TwitterCore/Loading.qml | 49 ++++ .../qml/twitter/TwitterCore/MultiTitleBar.qml | 60 ++++ .../twitter/qml/twitter/TwitterCore/RssModel.qml | 76 +++++ .../twitter/qml/twitter/TwitterCore/SearchView.qml | 124 ++++++++ .../twitter/qml/twitter/TwitterCore/TitleBar.qml | 130 +++++++++ .../twitter/qml/twitter/TwitterCore/ToolBar.qml | 64 +++++ .../twitter/qml/twitter/TwitterCore/UserModel.qml | 65 +++++ .../qml/twitter/TwitterCore/images/gloss.png | Bin 0 -> 1236 bytes .../qml/twitter/TwitterCore/images/lineedit.png | Bin 0 -> 1415 bytes .../qml/twitter/TwitterCore/images/lineedit.sci | 5 + .../qml/twitter/TwitterCore/images/loading.png | Bin 0 -> 813 bytes .../qml/twitter/TwitterCore/images/quit.png | Bin 0 -> 2369 bytes .../qml/twitter/TwitterCore/images/stripes.png | Bin 0 -> 257 bytes .../qml/twitter/TwitterCore/images/titlebar.png | Bin 0 -> 1436 bytes .../qml/twitter/TwitterCore/images/titlebar.sci | 5 + .../qml/twitter/TwitterCore/images/toolbutton.png | Bin 0 -> 2550 bytes .../qml/twitter/TwitterCore/images/toolbutton.sci | 5 + .../demos/twitter/qml/twitter/TwitterCore/qmldir | 10 + .../demos/twitter/qml/twitter/twitter.qml | 134 +++++++++ examples/declarative/demos/twitter/twitter.desktop | 11 + examples/declarative/demos/twitter/twitter.pro | 24 ++ .../declarative/demos/twitter/twitter.qmlproject | 16 ++ examples/declarative/demos/twitter/twitter.svg | 93 ++++++ examples/declarative/demos/twitter/twitter64.png | Bin 0 -> 3400 bytes examples/declarative/demos/twitter/twitter80.png | Bin 0 -> 4945 bytes .../demos/twitter/twitter_harmattan.desktop | 11 + examples/declarative/minehunt/README | 6 - examples/declarative/minehunt/main.cpp | 62 ---- examples/declarative/minehunt/minehunt.cpp | 221 -------------- examples/declarative/minehunt/minehunt.h | 129 --------- examples/declarative/minehunt/minehunt.pro | 25 -- examples/declarative/minehunt/minehunt.qmlproject | 16 -- examples/declarative/minehunt/minehunt.qrc | 19 -- .../qml/minehunt/MinehuntCore/Explosion.qml | 65 ----- .../minehunt/qml/minehunt/MinehuntCore/Tile.qml | 128 --------- .../qml/minehunt/MinehuntCore/pics/back.png | Bin 558 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/background.png | Bin 313930 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/bomb-color.png | Bin 284 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/bomb.png | Bin 535 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/face-sad.png | Bin 14844 -> 0 bytes .../minehunt/MinehuntCore/pics/face-smile-big.png | Bin 13810 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/face-smile.png | Bin 15408 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/flag-color.png | Bin 219 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/flag.png | Bin 196 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/front.png | Bin 580 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/quit.png | Bin 583 -> 0 bytes .../qml/minehunt/MinehuntCore/pics/star.png | Bin 2677 -> 0 bytes .../declarative/minehunt/qml/minehunt/minehunt.qml | 112 -------- examples/declarative/photoviewer/main.cpp | 55 ---- .../declarative/photoviewer/photoviewer.desktop | 11 - examples/declarative/photoviewer/photoviewer.pro | 24 -- .../declarative/photoviewer/photoviewer.qmlproject | 16 -- examples/declarative/photoviewer/photoviewer.svg | 93 ------ examples/declarative/photoviewer/photoviewer64.png | Bin 3400 -> 0 bytes examples/declarative/photoviewer/photoviewer80.png | Bin 4945 -> 0 bytes .../photoviewer/photoviewer_harmattan.desktop | 11 - .../photoviewer/PhotoViewerCore/AlbumDelegate.qml | 146 ---------- .../photoviewer/PhotoViewerCore/BusyIndicator.qml | 50 ---- .../qml/photoviewer/PhotoViewerCore/Button.qml | 72 ----- .../photoviewer/PhotoViewerCore/EditableButton.qml | 86 ------ .../photoviewer/PhotoViewerCore/PhotoDelegate.qml | 188 ------------ .../photoviewer/PhotoViewerCore/ProgressBar.qml | 57 ---- .../qml/photoviewer/PhotoViewerCore/RssModel.qml | 54 ---- .../qml/photoviewer/PhotoViewerCore/Tag.qml | 91 ------ .../PhotoViewerCore/images/box-shadow.png | Bin 588 -> 0 bytes .../photoviewer/PhotoViewerCore/images/busy.png | Bin 2629 -> 0 bytes .../PhotoViewerCore/images/cardboard.png | Bin 8844 -> 0 bytes .../qml/photoviewer/PhotoViewerCore/qmldir | 8 - .../photoviewer/PhotoViewerCore/script/script.js | 27 -- .../photoviewer/qml/photoviewer/i18n/base.ts | 30 -- .../photoviewer/qml/photoviewer/i18n/qml_fr.qm | Bin 268 -> 0 bytes .../photoviewer/qml/photoviewer/i18n/qml_fr.ts | 30 -- .../photoviewer/qml/photoviewer/photoviewer.qml | 110 ------- examples/declarative/rssnews/main.cpp | 55 ---- .../rssnews/qml/rssnews/content/BusyIndicator.qml | 53 ---- .../qml/rssnews/content/CategoryDelegate.qml | 82 ------ .../rssnews/qml/rssnews/content/NewsDelegate.qml | 71 ----- .../rssnews/qml/rssnews/content/RssFeeds.qml | 59 ---- .../rssnews/qml/rssnews/content/ScrollBar.qml | 107 ------- .../rssnews/qml/rssnews/content/images/busy.png | Bin 2629 -> 0 bytes .../qml/rssnews/content/images/scrollbar.png | Bin 161 -> 0 bytes .../declarative/rssnews/qml/rssnews/rssnews.qml | 111 -------- examples/declarative/rssnews/rssnews.desktop | 11 - examples/declarative/rssnews/rssnews.pro | 24 -- examples/declarative/rssnews/rssnews.qmlproject | 16 -- examples/declarative/rssnews/rssnews.svg | 93 ------ examples/declarative/rssnews/rssnews64.png | Bin 3400 -> 0 bytes examples/declarative/rssnews/rssnews80.png | Bin 4945 -> 0 bytes .../declarative/rssnews/rssnews_harmattan.desktop | 11 - examples/declarative/samegame/main.cpp | 55 ---- .../qml/samegame/SamegameCore/BoomBlock.qml | 109 ------- .../samegame/qml/samegame/SamegameCore/Button.qml | 75 ----- .../samegame/qml/samegame/SamegameCore/Dialog.qml | 77 ----- .../qml/samegame/SamegameCore/pics/background.png | Bin 313930 -> 0 bytes .../qml/samegame/SamegameCore/pics/blueStar.png | Bin 278 -> 0 bytes .../qml/samegame/SamegameCore/pics/blueStone.png | Bin 3054 -> 0 bytes .../qml/samegame/SamegameCore/pics/greenStar.png | Bin 273 -> 0 bytes .../qml/samegame/SamegameCore/pics/greenStone.png | Bin 2932 -> 0 bytes .../qml/samegame/SamegameCore/pics/redStar.png | Bin 274 -> 0 bytes .../qml/samegame/SamegameCore/pics/redStone.png | Bin 2902 -> 0 bytes .../qml/samegame/SamegameCore/pics/star.png | Bin 262 -> 0 bytes .../qml/samegame/SamegameCore/pics/yellowStone.png | Bin 3056 -> 0 bytes .../samegame/qml/samegame/SamegameCore/qmldir | 3 - .../samegame/qml/samegame/SamegameCore/samegame.js | 288 ------------------- .../samegame/qml/samegame/highscores/README | 1 - .../qml/samegame/highscores/score_data.xml | 2 - .../qml/samegame/highscores/score_style.xsl | 28 -- .../samegame/qml/samegame/highscores/scores.php | 34 --- .../declarative/samegame/qml/samegame/samegame.qml | 161 ----------- examples/declarative/samegame/samegame.desktop | 11 - examples/declarative/samegame/samegame.pro | 24 -- examples/declarative/samegame/samegame.qmlproject | 16 -- examples/declarative/samegame/samegame.svg | 93 ------ examples/declarative/samegame/samegame64.png | Bin 3400 -> 0 bytes examples/declarative/samegame/samegame80.png | Bin 4945 -> 0 bytes .../samegame/samegame_harmattan.desktop | 11 - examples/declarative/snake/main.cpp | 55 ---- .../declarative/snake/qml/snake/content/Button.qml | 66 ----- .../declarative/snake/qml/snake/content/Cookie.qml | 93 ------ .../snake/qml/snake/content/HighScoreModel.qml | 139 --------- .../declarative/snake/qml/snake/content/Link.qml | 128 --------- .../declarative/snake/qml/snake/content/Skull.qml | 62 ---- .../snake/qml/snake/content/pics/README | 1 - .../snake/qml/snake/content/pics/background.png | Bin 144508 -> 0 bytes .../snake/qml/snake/content/pics/blueStar.png | Bin 272 -> 0 bytes .../snake/qml/snake/content/pics/blueStone.png | Bin 3139 -> 0 bytes .../snake/qml/snake/content/pics/cookie.png | Bin 2729 -> 0 bytes .../snake/qml/snake/content/pics/eyes.svg | 118 -------- .../snake/qml/snake/content/pics/head.png | Bin 3473 -> 0 bytes .../snake/qml/snake/content/pics/head.svg | 134 --------- .../snake/qml/snake/content/pics/pause.png | Bin 4327 -> 0 bytes .../snake/qml/snake/content/pics/redStar.png | Bin 273 -> 0 bytes .../snake/qml/snake/content/pics/redStone.png | Bin 3456 -> 0 bytes .../snake/qml/snake/content/pics/skull.png | Bin 2543 -> 0 bytes .../snake/qml/snake/content/pics/snake.jpg | Bin 663901 -> 0 bytes .../snake/qml/snake/content/pics/star.png | Bin 262 -> 0 bytes .../snake/qml/snake/content/pics/stoneShadow.png | Bin 1699 -> 0 bytes .../snake/qml/snake/content/pics/yellowStar.png | Bin 276 -> 0 bytes .../snake/qml/snake/content/pics/yellowStone.png | Bin 2667 -> 0 bytes .../declarative/snake/qml/snake/content/snake.js | 316 --------------------- examples/declarative/snake/qml/snake/snake.qml | 272 ------------------ examples/declarative/snake/snake.desktop | 11 - examples/declarative/snake/snake.pro | 24 -- examples/declarative/snake/snake.qmlproject | 16 -- examples/declarative/snake/snake.svg | 93 ------ examples/declarative/snake/snake64.png | Bin 3400 -> 0 bytes examples/declarative/snake/snake80.png | Bin 4945 -> 0 bytes examples/declarative/snake/snake_harmattan.desktop | 11 - examples/declarative/twitter/main.cpp | 55 ---- .../twitter/qml/twitter/TwitterCore/Button.qml | 90 ------ .../qml/twitter/TwitterCore/FatDelegate.qml | 105 ------- .../twitter/qml/twitter/TwitterCore/Input.qml | 65 ----- .../twitter/qml/twitter/TwitterCore/Loading.qml | 49 ---- .../qml/twitter/TwitterCore/MultiTitleBar.qml | 60 ---- .../twitter/qml/twitter/TwitterCore/RssModel.qml | 76 ----- .../twitter/qml/twitter/TwitterCore/SearchView.qml | 124 -------- .../twitter/qml/twitter/TwitterCore/TitleBar.qml | 130 --------- .../twitter/qml/twitter/TwitterCore/ToolBar.qml | 64 ----- .../twitter/qml/twitter/TwitterCore/UserModel.qml | 65 ----- .../qml/twitter/TwitterCore/images/gloss.png | Bin 1236 -> 0 bytes .../qml/twitter/TwitterCore/images/lineedit.png | Bin 1415 -> 0 bytes .../qml/twitter/TwitterCore/images/lineedit.sci | 5 - .../qml/twitter/TwitterCore/images/loading.png | Bin 813 -> 0 bytes .../qml/twitter/TwitterCore/images/quit.png | Bin 2369 -> 0 bytes .../qml/twitter/TwitterCore/images/stripes.png | Bin 257 -> 0 bytes .../qml/twitter/TwitterCore/images/titlebar.png | Bin 1436 -> 0 bytes .../qml/twitter/TwitterCore/images/titlebar.sci | 5 - .../qml/twitter/TwitterCore/images/toolbutton.png | Bin 2550 -> 0 bytes .../qml/twitter/TwitterCore/images/toolbutton.sci | 5 - .../twitter/qml/twitter/TwitterCore/qmldir | 10 - .../declarative/twitter/qml/twitter/twitter.qml | 134 --------- examples/declarative/twitter/twitter.desktop | 11 - examples/declarative/twitter/twitter.pro | 24 -- examples/declarative/twitter/twitter.qmlproject | 16 -- examples/declarative/twitter/twitter.svg | 93 ------ examples/declarative/twitter/twitter64.png | Bin 3400 -> 0 bytes examples/declarative/twitter/twitter80.png | Bin 4945 -> 0 bytes .../declarative/twitter/twitter_harmattan.desktop | 11 - .../demos/doc/images/qml-calculator-example.png | Bin 33892 -> 0 bytes examples/demos/doc/images/qml-minehunt-demo.png | Bin 170648 -> 0 bytes examples/demos/doc/images/qml-photoviewer-demo.png | Bin 473306 -> 0 bytes examples/demos/doc/images/qml-rssnews-demo.png | Bin 128307 -> 0 bytes examples/demos/doc/images/qml-samegame-demo.png | Bin 213137 -> 0 bytes examples/demos/doc/images/qml-snake-demo.png | Bin 105053 -> 0 bytes examples/demos/doc/images/qml-twitter-demo.png | Bin 95812 -> 0 bytes examples/demos/doc/src/qml-calculator.qdoc | 37 --- examples/demos/doc/src/qml-minehunt.qdoc | 38 --- examples/demos/doc/src/qml-photoviewer.qdoc | 37 --- examples/demos/doc/src/qml-rssnews.qdoc | 37 --- examples/demos/doc/src/qml-samegame.qdoc | 38 --- examples/demos/doc/src/qml-snake.qdoc | 38 --- examples/demos/doc/src/qml-twitter.qdoc | 38 --- 372 files changed, 7252 insertions(+), 7248 deletions(-) delete mode 100644 examples/declarative/calculator/calculator.desktop delete mode 100644 examples/declarative/calculator/calculator.pro delete mode 100644 examples/declarative/calculator/calculator.qmlproject delete mode 100644 examples/declarative/calculator/calculator.svg delete mode 100644 examples/declarative/calculator/calculator64.png delete mode 100644 examples/declarative/calculator/calculator80.png delete mode 100644 examples/declarative/calculator/calculator_harmattan.desktop delete mode 100644 examples/declarative/calculator/main.cpp delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/Button.qml delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/Display.qml delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/calculator.js delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/images/display.png delete mode 100644 examples/declarative/calculator/qml/calculator/CalculatorCore/qmldir delete mode 100644 examples/declarative/calculator/qml/calculator/calculator.qml create mode 100644 examples/declarative/demos/calculator/calculator.desktop create mode 100644 examples/declarative/demos/calculator/calculator.pro create mode 100644 examples/declarative/demos/calculator/calculator.qmlproject create mode 100644 examples/declarative/demos/calculator/calculator.svg create mode 100644 examples/declarative/demos/calculator/calculator64.png create mode 100644 examples/declarative/demos/calculator/calculator80.png create mode 100644 examples/declarative/demos/calculator/calculator_harmattan.desktop create mode 100644 examples/declarative/demos/calculator/main.cpp create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Button.qml create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Display.qml create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/calculator.js create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-.png create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-blue.png create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-green.png create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-purple.png create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-red.png create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/display.png create mode 100644 examples/declarative/demos/calculator/qml/calculator/CalculatorCore/qmldir create mode 100644 examples/declarative/demos/calculator/qml/calculator/calculator.qml create mode 100644 examples/declarative/demos/demos.pro create mode 100644 examples/declarative/demos/doc/images/qml-calculator-example.png create mode 100644 examples/declarative/demos/doc/images/qml-minehunt-demo.png create mode 100644 examples/declarative/demos/doc/images/qml-photoviewer-demo.png create mode 100644 examples/declarative/demos/doc/images/qml-rssnews-demo.png create mode 100644 examples/declarative/demos/doc/images/qml-samegame-demo.png create mode 100644 examples/declarative/demos/doc/images/qml-snake-demo.png create mode 100644 examples/declarative/demos/doc/images/qml-twitter-demo.png create mode 100644 examples/declarative/demos/doc/src/qml-calculator.qdoc create mode 100644 examples/declarative/demos/doc/src/qml-minehunt.qdoc create mode 100644 examples/declarative/demos/doc/src/qml-photoviewer.qdoc create mode 100644 examples/declarative/demos/doc/src/qml-rssnews.qdoc create mode 100644 examples/declarative/demos/doc/src/qml-samegame.qdoc create mode 100644 examples/declarative/demos/doc/src/qml-snake.qdoc create mode 100644 examples/declarative/demos/doc/src/qml-twitter.qdoc create mode 100644 examples/declarative/demos/minehunt/README create mode 100644 examples/declarative/demos/minehunt/main.cpp create mode 100644 examples/declarative/demos/minehunt/minehunt.cpp create mode 100644 examples/declarative/demos/minehunt/minehunt.h create mode 100644 examples/declarative/demos/minehunt/minehunt.pro create mode 100644 examples/declarative/demos/minehunt/minehunt.qmlproject create mode 100644 examples/declarative/demos/minehunt/minehunt.qrc create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Explosion.qml create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Tile.qml create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/back.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/background.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/front.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/quit.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/star.png create mode 100644 examples/declarative/demos/minehunt/qml/minehunt/minehunt.qml create mode 100644 examples/declarative/demos/photoviewer/main.cpp create mode 100644 examples/declarative/demos/photoviewer/photoviewer.desktop create mode 100644 examples/declarative/demos/photoviewer/photoviewer.pro create mode 100644 examples/declarative/demos/photoviewer/photoviewer.qmlproject create mode 100644 examples/declarative/demos/photoviewer/photoviewer.svg create mode 100644 examples/declarative/demos/photoviewer/photoviewer64.png create mode 100644 examples/declarative/demos/photoviewer/photoviewer80.png create mode 100644 examples/declarative/demos/photoviewer/photoviewer_harmattan.desktop create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/i18n/base.ts create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.qm create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.ts create mode 100644 examples/declarative/demos/photoviewer/qml/photoviewer/photoviewer.qml create mode 100644 examples/declarative/demos/rssnews/main.cpp create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/BusyIndicator.qml create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/CategoryDelegate.qml create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/NewsDelegate.qml create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/RssFeeds.qml create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/ScrollBar.qml create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/images/busy.png create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/content/images/scrollbar.png create mode 100644 examples/declarative/demos/rssnews/qml/rssnews/rssnews.qml create mode 100644 examples/declarative/demos/rssnews/rssnews.desktop create mode 100644 examples/declarative/demos/rssnews/rssnews.pro create mode 100644 examples/declarative/demos/rssnews/rssnews.qmlproject create mode 100644 examples/declarative/demos/rssnews/rssnews.svg create mode 100644 examples/declarative/demos/rssnews/rssnews64.png create mode 100644 examples/declarative/demos/rssnews/rssnews80.png create mode 100644 examples/declarative/demos/rssnews/rssnews_harmattan.desktop create mode 100644 examples/declarative/demos/samegame/main.cpp create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/BoomBlock.qml create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/Button.qml create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/Dialog.qml create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/background.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStar.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStone.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStar.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStone.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStar.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStone.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/star.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/yellowStone.png create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/qmldir create mode 100644 examples/declarative/demos/samegame/qml/samegame/SamegameCore/samegame.js create mode 100644 examples/declarative/demos/samegame/qml/samegame/highscores/README create mode 100644 examples/declarative/demos/samegame/qml/samegame/highscores/score_data.xml create mode 100644 examples/declarative/demos/samegame/qml/samegame/highscores/score_style.xsl create mode 100644 examples/declarative/demos/samegame/qml/samegame/highscores/scores.php create mode 100644 examples/declarative/demos/samegame/qml/samegame/samegame.qml create mode 100644 examples/declarative/demos/samegame/samegame.desktop create mode 100644 examples/declarative/demos/samegame/samegame.pro create mode 100644 examples/declarative/demos/samegame/samegame.qmlproject create mode 100644 examples/declarative/demos/samegame/samegame.svg create mode 100644 examples/declarative/demos/samegame/samegame64.png create mode 100644 examples/declarative/demos/samegame/samegame80.png create mode 100644 examples/declarative/demos/samegame/samegame_harmattan.desktop create mode 100644 examples/declarative/demos/snake/main.cpp create mode 100644 examples/declarative/demos/snake/qml/snake/content/Button.qml create mode 100644 examples/declarative/demos/snake/qml/snake/content/Cookie.qml create mode 100644 examples/declarative/demos/snake/qml/snake/content/HighScoreModel.qml create mode 100644 examples/declarative/demos/snake/qml/snake/content/Link.qml create mode 100644 examples/declarative/demos/snake/qml/snake/content/Skull.qml create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/README create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/background.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/blueStar.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/blueStone.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/cookie.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/eyes.svg create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/head.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/head.svg create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/pause.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/redStar.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/redStone.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/skull.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/snake.jpg create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/star.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/stoneShadow.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/yellowStar.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/pics/yellowStone.png create mode 100644 examples/declarative/demos/snake/qml/snake/content/snake.js create mode 100644 examples/declarative/demos/snake/qml/snake/snake.qml create mode 100644 examples/declarative/demos/snake/snake.desktop create mode 100644 examples/declarative/demos/snake/snake.pro create mode 100644 examples/declarative/demos/snake/snake.qmlproject create mode 100644 examples/declarative/demos/snake/snake.svg create mode 100644 examples/declarative/demos/snake/snake64.png create mode 100644 examples/declarative/demos/snake/snake80.png create mode 100644 examples/declarative/demos/snake/snake_harmattan.desktop create mode 100644 examples/declarative/demos/twitter/main.cpp create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci create mode 100644 examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir create mode 100644 examples/declarative/demos/twitter/qml/twitter/twitter.qml create mode 100644 examples/declarative/demos/twitter/twitter.desktop create mode 100644 examples/declarative/demos/twitter/twitter.pro create mode 100644 examples/declarative/demos/twitter/twitter.qmlproject create mode 100644 examples/declarative/demos/twitter/twitter.svg create mode 100644 examples/declarative/demos/twitter/twitter64.png create mode 100644 examples/declarative/demos/twitter/twitter80.png create mode 100644 examples/declarative/demos/twitter/twitter_harmattan.desktop delete mode 100644 examples/declarative/minehunt/README delete mode 100644 examples/declarative/minehunt/main.cpp delete mode 100644 examples/declarative/minehunt/minehunt.cpp delete mode 100644 examples/declarative/minehunt/minehunt.h delete mode 100644 examples/declarative/minehunt/minehunt.pro delete mode 100644 examples/declarative/minehunt/minehunt.qmlproject delete mode 100644 examples/declarative/minehunt/minehunt.qrc delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png delete mode 100644 examples/declarative/minehunt/qml/minehunt/minehunt.qml delete mode 100644 examples/declarative/photoviewer/main.cpp delete mode 100644 examples/declarative/photoviewer/photoviewer.desktop delete mode 100644 examples/declarative/photoviewer/photoviewer.pro delete mode 100644 examples/declarative/photoviewer/photoviewer.qmlproject delete mode 100644 examples/declarative/photoviewer/photoviewer.svg delete mode 100644 examples/declarative/photoviewer/photoviewer64.png delete mode 100644 examples/declarative/photoviewer/photoviewer80.png delete mode 100644 examples/declarative/photoviewer/photoviewer_harmattan.desktop delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/i18n/base.ts delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts delete mode 100644 examples/declarative/photoviewer/qml/photoviewer/photoviewer.qml delete mode 100644 examples/declarative/rssnews/main.cpp delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/RssFeeds.qml delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/ScrollBar.qml delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/images/busy.png delete mode 100644 examples/declarative/rssnews/qml/rssnews/content/images/scrollbar.png delete mode 100644 examples/declarative/rssnews/qml/rssnews/rssnews.qml delete mode 100644 examples/declarative/rssnews/rssnews.desktop delete mode 100644 examples/declarative/rssnews/rssnews.pro delete mode 100644 examples/declarative/rssnews/rssnews.qmlproject delete mode 100644 examples/declarative/rssnews/rssnews.svg delete mode 100644 examples/declarative/rssnews/rssnews64.png delete mode 100644 examples/declarative/rssnews/rssnews80.png delete mode 100644 examples/declarative/rssnews/rssnews_harmattan.desktop delete mode 100644 examples/declarative/samegame/main.cpp delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/Button.qml delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/background.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/star.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/qmldir delete mode 100644 examples/declarative/samegame/qml/samegame/SamegameCore/samegame.js delete mode 100644 examples/declarative/samegame/qml/samegame/highscores/README delete mode 100644 examples/declarative/samegame/qml/samegame/highscores/score_data.xml delete mode 100644 examples/declarative/samegame/qml/samegame/highscores/score_style.xsl delete mode 100644 examples/declarative/samegame/qml/samegame/highscores/scores.php delete mode 100644 examples/declarative/samegame/qml/samegame/samegame.qml delete mode 100644 examples/declarative/samegame/samegame.desktop delete mode 100644 examples/declarative/samegame/samegame.pro delete mode 100644 examples/declarative/samegame/samegame.qmlproject delete mode 100644 examples/declarative/samegame/samegame.svg delete mode 100644 examples/declarative/samegame/samegame64.png delete mode 100644 examples/declarative/samegame/samegame80.png delete mode 100644 examples/declarative/samegame/samegame_harmattan.desktop delete mode 100644 examples/declarative/snake/main.cpp delete mode 100644 examples/declarative/snake/qml/snake/content/Button.qml delete mode 100644 examples/declarative/snake/qml/snake/content/Cookie.qml delete mode 100644 examples/declarative/snake/qml/snake/content/HighScoreModel.qml delete mode 100644 examples/declarative/snake/qml/snake/content/Link.qml delete mode 100644 examples/declarative/snake/qml/snake/content/Skull.qml delete mode 100644 examples/declarative/snake/qml/snake/content/pics/README delete mode 100644 examples/declarative/snake/qml/snake/content/pics/background.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/blueStar.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/blueStone.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/cookie.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/eyes.svg delete mode 100644 examples/declarative/snake/qml/snake/content/pics/head.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/head.svg delete mode 100644 examples/declarative/snake/qml/snake/content/pics/pause.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/redStar.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/redStone.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/skull.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/snake.jpg delete mode 100644 examples/declarative/snake/qml/snake/content/pics/star.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/stoneShadow.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/yellowStar.png delete mode 100644 examples/declarative/snake/qml/snake/content/pics/yellowStone.png delete mode 100644 examples/declarative/snake/qml/snake/content/snake.js delete mode 100644 examples/declarative/snake/qml/snake/snake.qml delete mode 100644 examples/declarative/snake/snake.desktop delete mode 100644 examples/declarative/snake/snake.pro delete mode 100644 examples/declarative/snake/snake.qmlproject delete mode 100644 examples/declarative/snake/snake.svg delete mode 100644 examples/declarative/snake/snake64.png delete mode 100644 examples/declarative/snake/snake80.png delete mode 100644 examples/declarative/snake/snake_harmattan.desktop delete mode 100644 examples/declarative/twitter/main.cpp delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/Button.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/Input.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/Loading.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/loading.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/quit.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci delete mode 100644 examples/declarative/twitter/qml/twitter/TwitterCore/qmldir delete mode 100644 examples/declarative/twitter/qml/twitter/twitter.qml delete mode 100644 examples/declarative/twitter/twitter.desktop delete mode 100644 examples/declarative/twitter/twitter.pro delete mode 100644 examples/declarative/twitter/twitter.qmlproject delete mode 100644 examples/declarative/twitter/twitter.svg delete mode 100644 examples/declarative/twitter/twitter64.png delete mode 100644 examples/declarative/twitter/twitter80.png delete mode 100644 examples/declarative/twitter/twitter_harmattan.desktop delete mode 100644 examples/demos/doc/images/qml-calculator-example.png delete mode 100644 examples/demos/doc/images/qml-minehunt-demo.png delete mode 100644 examples/demos/doc/images/qml-photoviewer-demo.png delete mode 100644 examples/demos/doc/images/qml-rssnews-demo.png delete mode 100644 examples/demos/doc/images/qml-samegame-demo.png delete mode 100644 examples/demos/doc/images/qml-snake-demo.png delete mode 100644 examples/demos/doc/images/qml-twitter-demo.png delete mode 100644 examples/demos/doc/src/qml-calculator.qdoc delete mode 100644 examples/demos/doc/src/qml-minehunt.qdoc delete mode 100644 examples/demos/doc/src/qml-photoviewer.qdoc delete mode 100644 examples/demos/doc/src/qml-rssnews.qdoc delete mode 100644 examples/demos/doc/src/qml-samegame.qdoc delete mode 100644 examples/demos/doc/src/qml-snake.qdoc delete mode 100644 examples/demos/doc/src/qml-twitter.qdoc diff --git a/examples/declarative/calculator/calculator.desktop b/examples/declarative/calculator/calculator.desktop deleted file mode 100644 index 854120f2..00000000 --- a/examples/declarative/calculator/calculator.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=calculator -Exec=/opt/calculator/bin/calculator -Icon=calculator64 -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/calculator/calculator.pro b/examples/declarative/calculator/calculator.pro deleted file mode 100644 index 3591af05..00000000 --- a/examples/declarative/calculator/calculator.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/calculator -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/calculator -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/calculator/calculator.qmlproject b/examples/declarative/calculator/calculator.qmlproject deleted file mode 100644 index 88ca3caa..00000000 --- a/examples/declarative/calculator/calculator.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/calculator" - } - JavaScriptFiles { - directory: "qml/calculator" - } - ImageFiles { - directory: "qml/calculator" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/calculator/calculator.svg b/examples/declarative/calculator/calculator.svg deleted file mode 100644 index 566acfad..00000000 --- a/examples/declarative/calculator/calculator.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/calculator/calculator64.png b/examples/declarative/calculator/calculator64.png deleted file mode 100644 index 707d5c4e..00000000 Binary files a/examples/declarative/calculator/calculator64.png and /dev/null differ diff --git a/examples/declarative/calculator/calculator80.png b/examples/declarative/calculator/calculator80.png deleted file mode 100644 index 6ad8096c..00000000 Binary files a/examples/declarative/calculator/calculator80.png and /dev/null differ diff --git a/examples/declarative/calculator/calculator_harmattan.desktop b/examples/declarative/calculator/calculator_harmattan.desktop deleted file mode 100644 index 574521d8..00000000 --- a/examples/declarative/calculator/calculator_harmattan.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=calculator -Exec=/usr/bin/single-instance /opt/calculator/bin/calculator -Icon=/usr/share/icons/hicolor/80x80/apps/calculator80.png -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/calculator/main.cpp b/examples/declarative/calculator/main.cpp deleted file mode 100644 index e10d3011..00000000 --- a/examples/declarative/calculator/main.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include -#include - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - qDebug() << "NOTE: The runtime property and the Orientation enum are only available" - << "through qmlviewer and are not available in the complied version.\n" - << "Run 'qmlviewer calculator.qmlproject' or load 'calculator.qmlproject'" - << "in Qt Creator and run the project."; - - QmlApplicationViewer viewer; - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); - viewer.setMainQmlFile(QLatin1String("qml/calculator/calculator.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/Button.qml b/examples/declarative/calculator/qml/calculator/CalculatorCore/Button.qml deleted file mode 100644 index b3589257..00000000 --- a/examples/declarative/calculator/qml/calculator/CalculatorCore/Button.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -BorderImage { - id: button - - property alias operation: buttonText.text - property string color: "" - - signal clicked - - source: "images/button-" + color + ".png"; clip: true - border { left: 10; top: 10; right: 10; bottom: 10 } - - Rectangle { - id: shade - anchors.fill: button; radius: 10; color: "black"; opacity: 0 - } - - Text { - id: buttonText - anchors.centerIn: parent; anchors.verticalCenterOffset: -1 - font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5 - style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true - } - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - doOp(operation) - button.clicked() - } - } - - states: State { - name: "pressed"; when: mouseArea.pressed == true - PropertyChanges { target: shade; opacity: .4 } - } -} diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/Display.qml b/examples/declarative/calculator/qml/calculator/CalculatorCore/Display.qml deleted file mode 100644 index f744bcad..00000000 --- a/examples/declarative/calculator/qml/calculator/CalculatorCore/Display.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -BorderImage { - id: image - - property alias text : displayText.text - property alias currentOperation : operationText - - source: "images/display.png" - border { left: 10; top: 10; right: 10; bottom: 10 } - - Text { - id: displayText - anchors { - right: parent.right; verticalCenter: parent.verticalCenter; verticalCenterOffset: -1 - rightMargin: 6; left: operationText.right - } - font.pixelSize: parent.height * .6; text: "0"; horizontalAlignment: Text.AlignRight; elide: Text.ElideRight - color: "#343434"; smooth: true; font.bold: true - } - Text { - id: operationText - font.bold: true; font.pixelSize: parent.height * .7 - color: "#343434"; smooth: true - anchors { left: parent.left; leftMargin: 6; verticalCenterOffset: -3; verticalCenter: parent.verticalCenter } - } -} diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/calculator.js b/examples/declarative/calculator/qml/calculator/CalculatorCore/calculator.js deleted file mode 100644 index 7c363c7f..00000000 --- a/examples/declarative/calculator/qml/calculator/CalculatorCore/calculator.js +++ /dev/null @@ -1,91 +0,0 @@ - -var curVal = 0 -var memory = 0 -var lastOp = "" -var timer = 0 - -function disabled(op) { - if (op == "." && display.text.toString().search(/\./) != -1) { - return true - } else if (op == squareRoot && display.text.toString().search(/-/) != -1) { - return true - } else { - return false - } -} - -function doOperation(op) { - if (disabled(op)) { - return - } - - if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) { - if (display.text.toString().length >= 14) - return; // No arbitrary length numbers - if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) { - display.text = display.text + op.toString() - } else { - display.text = op - } - lastOp = op - return - } - lastOp = op - - if (display.currentOperation.text == "+") { - display.text = Number(display.text.valueOf()) + Number(curVal.valueOf()) - } else if (display.currentOperation.text == "-") { - display.text = Number(curVal) - Number(display.text.valueOf()) - } else if (display.currentOperation.text == multiplication) { - display.text = Number(curVal) * Number(display.text.valueOf()) - } else if (display.currentOperation.text == division) { - display.text = Number(Number(curVal) / Number(display.text.valueOf())).toString() - } else if (display.currentOperation.text == "=") { - } - - if (op == "+" || op == "-" || op == multiplication || op == division) { - display.currentOperation.text = op - curVal = display.text.valueOf() - return - } - - curVal = 0 - display.currentOperation.text = "" - - if (op == "1/x") { - display.text = (1 / display.text.valueOf()).toString() - } else if (op == "x^2") { - display.text = (display.text.valueOf() * display.text.valueOf()).toString() - } else if (op == "Abs") { - display.text = (Math.abs(display.text.valueOf())).toString() - } else if (op == "Int") { - display.text = (Math.floor(display.text.valueOf())).toString() - } else if (op == plusminus) { - display.text = (display.text.valueOf() * -1).toString() - } else if (op == squareRoot) { - display.text = (Math.sqrt(display.text.valueOf())).toString() - } else if (op == "mc") { - memory = 0; - } else if (op == "m+") { - memory += display.text.valueOf() - } else if (op == "mr") { - display.text = memory.toString() - } else if (op == "m-") { - memory = display.text.valueOf() - } else if (op == leftArrow) { - display.text = display.text.toString().slice(0, -1) - if (display.text.length == 0) { - display.text = "0" - } - } else if (op == "Off") { - Qt.quit(); - } else if (op == "C") { - display.text = "0" - } else if (op == "AC") { - curVal = 0 - memory = 0 - lastOp = "" - display.text ="0" - } -} - diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png b/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png deleted file mode 100644 index 544e5145..00000000 Binary files a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-.png and /dev/null differ diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png b/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png deleted file mode 100644 index 5f92de32..00000000 Binary files a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-blue.png and /dev/null differ diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png b/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png deleted file mode 100644 index 36c93914..00000000 Binary files a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-green.png and /dev/null differ diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png b/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png deleted file mode 100644 index 347cbbea..00000000 Binary files a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-purple.png and /dev/null differ diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png b/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png deleted file mode 100644 index 3b335891..00000000 Binary files a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/button-red.png and /dev/null differ diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/display.png b/examples/declarative/calculator/qml/calculator/CalculatorCore/images/display.png deleted file mode 100644 index 9507f438..00000000 Binary files a/examples/declarative/calculator/qml/calculator/CalculatorCore/images/display.png and /dev/null differ diff --git a/examples/declarative/calculator/qml/calculator/CalculatorCore/qmldir b/examples/declarative/calculator/qml/calculator/CalculatorCore/qmldir deleted file mode 100644 index a926b93f..00000000 --- a/examples/declarative/calculator/qml/calculator/CalculatorCore/qmldir +++ /dev/null @@ -1,2 +0,0 @@ -Button Button.qml -Display Display.qml diff --git a/examples/declarative/calculator/qml/calculator/calculator.qml b/examples/declarative/calculator/qml/calculator/calculator.qml deleted file mode 100644 index d7355082..00000000 --- a/examples/declarative/calculator/qml/calculator/calculator.qml +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "CalculatorCore" -import "CalculatorCore/calculator.js" as CalcEngine - -Rectangle { - id: window - - width: 360; height: 480 - color: "#282828" - - property string rotateLeft: "\u2939" - property string rotateRight: "\u2935" - property string leftArrow: "\u2190" - property string division : "\u00f7" - property string multiplication : "\u00d7" - property string squareRoot : "\u221a" - property string plusminus : "\u00b1" - - function doOp(operation) { CalcEngine.doOperation(operation) } - - Item { - id: main - state: "orientation " + runtime.orientation - - property bool landscapeWindow: window.width > window.height - property real baseWidth: landscapeWindow ? window.height : window.width - property real baseHeight: landscapeWindow ? window.width : window.height - property real rotationDelta: landscapeWindow ? -90 : 0 - - rotation: rotationDelta - width: main.baseWidth - height: main.baseHeight - anchors.centerIn: parent - - Column { - id: box; spacing: 8 - - anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 } - - Display { - id: display - width: box.width-3 - height: 64 - } - - Column { - id: column; spacing: 6 - - property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6) - property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4) - - Row { - spacing: 6 - Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" } - Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow } - Button { width: column.w; height: column.h; color: 'purple'; operation: "C" } - Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" } - } - - Row { - spacing: 6 - property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4) - - Button { width: column.w; height: column.h; color: 'green'; operation: "mc" } - Button { width: column.w; height: column.h; color: 'green'; operation: "m+" } - Button { width: column.w; height: column.h; color: 'green'; operation: "m-" } - Button { width: column.w; height: column.h; color: 'green'; operation: "mr" } - } - - Grid { - id: grid; rows: 5; columns: 5; spacing: 6 - - property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns) - - Button { width: grid.w; height: column.h; operation: "7"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "8"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "9"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: division } - Button { width: grid.w; height: column.h; operation: squareRoot } - Button { width: grid.w; height: column.h; operation: "4"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "5"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "6"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: multiplication } - Button { width: grid.w; height: column.h; operation: "x^2" } - Button { width: grid.w; height: column.h; operation: "1"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "2"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "3"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "-" } - Button { width: grid.w; height: column.h; operation: "1/x" } - Button { width: grid.w; height: column.h; operation: "0"; color: 'blue' } - Button { width: grid.w; height: column.h; operation: "." } - Button { width: grid.w; height: column.h; operation: plusminus } - Button { width: grid.w; height: column.h; operation: "+" } - Button { width: grid.w; height: column.h; operation: "="; color: 'red' } - } - } - } - - states: [ - State { - name: "orientation " + Orientation.Landscape - PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth } - }, - State { - name: "orientation " + Orientation.PortraitInverted - PropertyChanges { target: main; rotation: 180 + rotationDelta; } - }, - State { - name: "orientation " + Orientation.LandscapeInverted - PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth } - } - ] - - transitions: Transition { - SequentialAnimation { - RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint } - NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } - } - } - } -} diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro index 123539ff..35f6d9c7 100644 --- a/examples/declarative/declarative.pro +++ b/examples/declarative/declarative.pro @@ -2,28 +2,22 @@ TEMPLATE = subdirs # These examples contain some C++ and need to be built SUBDIRS = \ + demos \ animation \ - calculator \ cppextensions \ flickr \ i18n \ imageelements \ keyinteraction/focus \ - minehunt \ modelviews \ - photoviewer \ positioners \ righttoleft \ - rssnews \ - samegame \ - snake \ sqllocalstorage \ text \ threading \ touchinteraction \ toys \ tutorials \ - twitter \ ui-components # OpenGL shader examples requires opengl and they contain some C++ and need to be built diff --git a/examples/declarative/demos/calculator/calculator.desktop b/examples/declarative/demos/calculator/calculator.desktop new file mode 100644 index 00000000..854120f2 --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=calculator +Exec=/opt/calculator/bin/calculator +Icon=calculator64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/calculator/calculator.pro b/examples/declarative/demos/calculator/calculator.pro new file mode 100644 index 00000000..1d9475d0 --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/calculator +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/calculator +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/calculator/calculator.qmlproject b/examples/declarative/demos/calculator/calculator.qmlproject new file mode 100644 index 00000000..88ca3caa --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/calculator" + } + JavaScriptFiles { + directory: "qml/calculator" + } + ImageFiles { + directory: "qml/calculator" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/calculator/calculator.svg b/examples/declarative/demos/calculator/calculator.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/calculator/calculator.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/calculator/calculator64.png b/examples/declarative/demos/calculator/calculator64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/calculator/calculator64.png differ diff --git a/examples/declarative/demos/calculator/calculator80.png b/examples/declarative/demos/calculator/calculator80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/calculator/calculator80.png differ diff --git a/examples/declarative/demos/calculator/calculator_harmattan.desktop b/examples/declarative/demos/calculator/calculator_harmattan.desktop new file mode 100644 index 00000000..574521d8 --- /dev/null +++ b/examples/declarative/demos/calculator/calculator_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=calculator +Exec=/usr/bin/single-instance /opt/calculator/bin/calculator +Icon=/usr/share/icons/hicolor/80x80/apps/calculator80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/calculator/main.cpp b/examples/declarative/demos/calculator/main.cpp new file mode 100644 index 00000000..e10d3011 --- /dev/null +++ b/examples/declarative/demos/calculator/main.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + qDebug() << "NOTE: The runtime property and the Orientation enum are only available" + << "through qmlviewer and are not available in the complied version.\n" + << "Run 'qmlviewer calculator.qmlproject' or load 'calculator.qmlproject'" + << "in Qt Creator and run the project."; + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/calculator/calculator.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Button.qml b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Button.qml new file mode 100644 index 00000000..b3589257 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Button.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +BorderImage { + id: button + + property alias operation: buttonText.text + property string color: "" + + signal clicked + + source: "images/button-" + color + ".png"; clip: true + border { left: 10; top: 10; right: 10; bottom: 10 } + + Rectangle { + id: shade + anchors.fill: button; radius: 10; color: "black"; opacity: 0 + } + + Text { + id: buttonText + anchors.centerIn: parent; anchors.verticalCenterOffset: -1 + font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5 + style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true + } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: { + doOp(operation) + button.clicked() + } + } + + states: State { + name: "pressed"; when: mouseArea.pressed == true + PropertyChanges { target: shade; opacity: .4 } + } +} diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Display.qml b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Display.qml new file mode 100644 index 00000000..f744bcad --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/Display.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +BorderImage { + id: image + + property alias text : displayText.text + property alias currentOperation : operationText + + source: "images/display.png" + border { left: 10; top: 10; right: 10; bottom: 10 } + + Text { + id: displayText + anchors { + right: parent.right; verticalCenter: parent.verticalCenter; verticalCenterOffset: -1 + rightMargin: 6; left: operationText.right + } + font.pixelSize: parent.height * .6; text: "0"; horizontalAlignment: Text.AlignRight; elide: Text.ElideRight + color: "#343434"; smooth: true; font.bold: true + } + Text { + id: operationText + font.bold: true; font.pixelSize: parent.height * .7 + color: "#343434"; smooth: true + anchors { left: parent.left; leftMargin: 6; verticalCenterOffset: -3; verticalCenter: parent.verticalCenter } + } +} diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/calculator.js b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/calculator.js new file mode 100644 index 00000000..7c363c7f --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/calculator.js @@ -0,0 +1,91 @@ + +var curVal = 0 +var memory = 0 +var lastOp = "" +var timer = 0 + +function disabled(op) { + if (op == "." && display.text.toString().search(/\./) != -1) { + return true + } else if (op == squareRoot && display.text.toString().search(/-/) != -1) { + return true + } else { + return false + } +} + +function doOperation(op) { + if (disabled(op)) { + return + } + + if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) { + if (display.text.toString().length >= 14) + return; // No arbitrary length numbers + if (lastOp.toString().length == 1 && ((lastOp >= "0" && lastOp <= "9") || lastOp == ".") ) { + display.text = display.text + op.toString() + } else { + display.text = op + } + lastOp = op + return + } + lastOp = op + + if (display.currentOperation.text == "+") { + display.text = Number(display.text.valueOf()) + Number(curVal.valueOf()) + } else if (display.currentOperation.text == "-") { + display.text = Number(curVal) - Number(display.text.valueOf()) + } else if (display.currentOperation.text == multiplication) { + display.text = Number(curVal) * Number(display.text.valueOf()) + } else if (display.currentOperation.text == division) { + display.text = Number(Number(curVal) / Number(display.text.valueOf())).toString() + } else if (display.currentOperation.text == "=") { + } + + if (op == "+" || op == "-" || op == multiplication || op == division) { + display.currentOperation.text = op + curVal = display.text.valueOf() + return + } + + curVal = 0 + display.currentOperation.text = "" + + if (op == "1/x") { + display.text = (1 / display.text.valueOf()).toString() + } else if (op == "x^2") { + display.text = (display.text.valueOf() * display.text.valueOf()).toString() + } else if (op == "Abs") { + display.text = (Math.abs(display.text.valueOf())).toString() + } else if (op == "Int") { + display.text = (Math.floor(display.text.valueOf())).toString() + } else if (op == plusminus) { + display.text = (display.text.valueOf() * -1).toString() + } else if (op == squareRoot) { + display.text = (Math.sqrt(display.text.valueOf())).toString() + } else if (op == "mc") { + memory = 0; + } else if (op == "m+") { + memory += display.text.valueOf() + } else if (op == "mr") { + display.text = memory.toString() + } else if (op == "m-") { + memory = display.text.valueOf() + } else if (op == leftArrow) { + display.text = display.text.toString().slice(0, -1) + if (display.text.length == 0) { + display.text = "0" + } + } else if (op == "Off") { + Qt.quit(); + } else if (op == "C") { + display.text = "0" + } else if (op == "AC") { + curVal = 0 + memory = 0 + lastOp = "" + display.text ="0" + } +} + diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-.png b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-.png new file mode 100644 index 00000000..544e5145 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-.png differ diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-blue.png b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-blue.png new file mode 100644 index 00000000..5f92de32 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-blue.png differ diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-green.png b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-green.png new file mode 100644 index 00000000..36c93914 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-green.png differ diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-purple.png b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-purple.png new file mode 100644 index 00000000..347cbbea Binary files /dev/null and b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-purple.png differ diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-red.png b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-red.png new file mode 100644 index 00000000..3b335891 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/button-red.png differ diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/display.png b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/display.png new file mode 100644 index 00000000..9507f438 Binary files /dev/null and b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/images/display.png differ diff --git a/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/qmldir b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/qmldir new file mode 100644 index 00000000..a926b93f --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator/CalculatorCore/qmldir @@ -0,0 +1,2 @@ +Button Button.qml +Display Display.qml diff --git a/examples/declarative/demos/calculator/qml/calculator/calculator.qml b/examples/declarative/demos/calculator/qml/calculator/calculator.qml new file mode 100644 index 00000000..d7355082 --- /dev/null +++ b/examples/declarative/demos/calculator/qml/calculator/calculator.qml @@ -0,0 +1,162 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "CalculatorCore" +import "CalculatorCore/calculator.js" as CalcEngine + +Rectangle { + id: window + + width: 360; height: 480 + color: "#282828" + + property string rotateLeft: "\u2939" + property string rotateRight: "\u2935" + property string leftArrow: "\u2190" + property string division : "\u00f7" + property string multiplication : "\u00d7" + property string squareRoot : "\u221a" + property string plusminus : "\u00b1" + + function doOp(operation) { CalcEngine.doOperation(operation) } + + Item { + id: main + state: "orientation " + runtime.orientation + + property bool landscapeWindow: window.width > window.height + property real baseWidth: landscapeWindow ? window.height : window.width + property real baseHeight: landscapeWindow ? window.width : window.height + property real rotationDelta: landscapeWindow ? -90 : 0 + + rotation: rotationDelta + width: main.baseWidth + height: main.baseHeight + anchors.centerIn: parent + + Column { + id: box; spacing: 8 + + anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 } + + Display { + id: display + width: box.width-3 + height: 64 + } + + Column { + id: column; spacing: 6 + + property real h: ((box.height - 72) / 6) - ((spacing * (6 - 1)) / 6) + property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4) + + Row { + spacing: 6 + Button { width: column.w; height: column.h; color: 'purple'; operation: "Off" } + Button { width: column.w; height: column.h; color: 'purple'; operation: leftArrow } + Button { width: column.w; height: column.h; color: 'purple'; operation: "C" } + Button { width: column.w; height: column.h; color: 'purple'; operation: "AC" } + } + + Row { + spacing: 6 + property real w: (box.width / 4) - ((spacing * (4 - 1)) / 4) + + Button { width: column.w; height: column.h; color: 'green'; operation: "mc" } + Button { width: column.w; height: column.h; color: 'green'; operation: "m+" } + Button { width: column.w; height: column.h; color: 'green'; operation: "m-" } + Button { width: column.w; height: column.h; color: 'green'; operation: "mr" } + } + + Grid { + id: grid; rows: 5; columns: 5; spacing: 6 + + property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns) + + Button { width: grid.w; height: column.h; operation: "7"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "8"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "9"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: division } + Button { width: grid.w; height: column.h; operation: squareRoot } + Button { width: grid.w; height: column.h; operation: "4"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "5"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "6"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: multiplication } + Button { width: grid.w; height: column.h; operation: "x^2" } + Button { width: grid.w; height: column.h; operation: "1"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "2"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "3"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "-" } + Button { width: grid.w; height: column.h; operation: "1/x" } + Button { width: grid.w; height: column.h; operation: "0"; color: 'blue' } + Button { width: grid.w; height: column.h; operation: "." } + Button { width: grid.w; height: column.h; operation: plusminus } + Button { width: grid.w; height: column.h; operation: "+" } + Button { width: grid.w; height: column.h; operation: "="; color: 'red' } + } + } + } + + states: [ + State { + name: "orientation " + Orientation.Landscape + PropertyChanges { target: main; rotation: 90 + rotationDelta; width: main.baseHeight; height: main.baseWidth } + }, + State { + name: "orientation " + Orientation.PortraitInverted + PropertyChanges { target: main; rotation: 180 + rotationDelta; } + }, + State { + name: "orientation " + Orientation.LandscapeInverted + PropertyChanges { target: main; rotation: 270 + rotationDelta; width: main.baseHeight; height: main.baseWidth } + } + ] + + transitions: Transition { + SequentialAnimation { + RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint } + NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } + } + } + } +} diff --git a/examples/declarative/demos/demos.pro b/examples/declarative/demos/demos.pro new file mode 100644 index 00000000..7fb61b8a --- /dev/null +++ b/examples/declarative/demos/demos.pro @@ -0,0 +1,10 @@ +TEMPLATE = subdirs + +SUBDIRS = \ + calculator \ + minehunt \ + photoviewer \ + rssnews \ + samegame \ + snake \ + twitter diff --git a/examples/declarative/demos/doc/images/qml-calculator-example.png b/examples/declarative/demos/doc/images/qml-calculator-example.png new file mode 100644 index 00000000..0f9ced80 Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-calculator-example.png differ diff --git a/examples/declarative/demos/doc/images/qml-minehunt-demo.png b/examples/declarative/demos/doc/images/qml-minehunt-demo.png new file mode 100644 index 00000000..3b695693 Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-minehunt-demo.png differ diff --git a/examples/declarative/demos/doc/images/qml-photoviewer-demo.png b/examples/declarative/demos/doc/images/qml-photoviewer-demo.png new file mode 100644 index 00000000..be6f1bf1 Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-photoviewer-demo.png differ diff --git a/examples/declarative/demos/doc/images/qml-rssnews-demo.png b/examples/declarative/demos/doc/images/qml-rssnews-demo.png new file mode 100644 index 00000000..b4143b46 Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-rssnews-demo.png differ diff --git a/examples/declarative/demos/doc/images/qml-samegame-demo.png b/examples/declarative/demos/doc/images/qml-samegame-demo.png new file mode 100644 index 00000000..945f2b96 Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-samegame-demo.png differ diff --git a/examples/declarative/demos/doc/images/qml-snake-demo.png b/examples/declarative/demos/doc/images/qml-snake-demo.png new file mode 100644 index 00000000..d3c077d1 Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-snake-demo.png differ diff --git a/examples/declarative/demos/doc/images/qml-twitter-demo.png b/examples/declarative/demos/doc/images/qml-twitter-demo.png new file mode 100644 index 00000000..63d6486a Binary files /dev/null and b/examples/declarative/demos/doc/images/qml-twitter-demo.png differ diff --git a/examples/declarative/demos/doc/src/qml-calculator.qdoc b/examples/declarative/demos/doc/src/qml-calculator.qdoc new file mode 100644 index 00000000..fb470771 --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-calculator.qdoc @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Calculator + \example declarative/demos/calculator + \brief Shows how to write a calculator in QML + \ingroup qmldemos + + This example shows how to write a simple calculator application in QML and JavaScript. + + \image qml-calculator-example.png +*/ diff --git a/examples/declarative/demos/doc/src/qml-minehunt.qdoc b/examples/declarative/demos/doc/src/qml-minehunt.qdoc new file mode 100644 index 00000000..0f7c3b3f --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-minehunt.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Minehunt + \example declarative/demos/minehunt + \brief Shows how to write a Minehunt game in QML + \ingroup qmldemos + + This example shows how to create a simple Minehunt game, using QML for the + UI and C++ for the game logic. + + \image qml-minehunt-demo.png +*/ diff --git a/examples/declarative/demos/doc/src/qml-photoviewer.qdoc b/examples/declarative/demos/doc/src/qml-photoviewer.qdoc new file mode 100644 index 00000000..af1c84cf --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-photoviewer.qdoc @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Photo Viewer + \example declarative/demos/photoviewer + \brief Shows how to write a Flickr photo viewer in QML + \ingroup qmldemos + + This example shows how to write a Flickr photo viewer application in QML. + + \image qml-photoviewer-demo.png +*/ diff --git a/examples/declarative/demos/doc/src/qml-rssnews.qdoc b/examples/declarative/demos/doc/src/qml-rssnews.qdoc new file mode 100644 index 00000000..60ba20e4 --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-rssnews.qdoc @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title RSS News + \example declarative/demos/rssnews + \brief Shows how to write an RSS news reader in QML + \ingroup qmldemos + + This example shows how to write an RSS news reader in QML. + + \image qml-rssnews-demo.png +*/ diff --git a/examples/declarative/demos/doc/src/qml-samegame.qdoc b/examples/declarative/demos/doc/src/qml-samegame.qdoc new file mode 100644 index 00000000..f8ebef0b --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-samegame.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Same Game + \example declarative/demos/samegame + \brief Shows how to write a Same Game in QML + \ingroup qmldemos + + This example shows how to write a 'Same Game' game in QML, using Javascript + for all the game logic. + + \image qml-samegame-demo.png +*/ diff --git a/examples/declarative/demos/doc/src/qml-snake.qdoc b/examples/declarative/demos/doc/src/qml-snake.qdoc new file mode 100644 index 00000000..131fabf8 --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-snake.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Snake + \example declarative/demos/snake + \brief Shows how to write a Snake game in QML + \ingroup qmldemos + + This example shows how to write a Snake game in QML, controlled by the + keyboard as well as the mouse. + + \image qml-snake-demo.png +*/ diff --git a/examples/declarative/demos/doc/src/qml-twitter.qdoc b/examples/declarative/demos/doc/src/qml-twitter.qdoc new file mode 100644 index 00000000..20b07baa --- /dev/null +++ b/examples/declarative/demos/doc/src/qml-twitter.qdoc @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \title Twitter Mobile + \example declarative/demos/twitter + \brief Shows how to write a Twitter client in QML + \ingroup qmldemos + + This example shows how to write a mobile Twitter search client in QML. Use it to + see what people think about Qt Quick! + + \image qml-twitter-demo.png +*/ diff --git a/examples/declarative/demos/minehunt/README b/examples/declarative/demos/minehunt/README new file mode 100644 index 00000000..3849ca5f --- /dev/null +++ b/examples/declarative/demos/minehunt/README @@ -0,0 +1,6 @@ +Minehunt has to be compiled to run. + +To compile the C++ part, do 'qmake && make'. +To run, simply run the executable. +To deploy on a device, do 'make sis'. + diff --git a/examples/declarative/demos/minehunt/main.cpp b/examples/declarative/demos/minehunt/main.cpp new file mode 100644 index 00000000..d23c2b3a --- /dev/null +++ b/examples/declarative/demos/minehunt/main.cpp @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include "minehunt.h" +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QmlApplicationViewer viewer; + + qmlRegisterType(); + MinehuntGame* game = new MinehuntGame(); + + viewer.engine()->rootContext()->setContextObject(game); + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); + viewer.setMainQmlFile(QLatin1String("qml/minehunt/minehunt.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/minehunt/minehunt.cpp b/examples/declarative/demos/minehunt/minehunt.cpp new file mode 100644 index 00000000..70ca035e --- /dev/null +++ b/examples/declarative/demos/minehunt/minehunt.cpp @@ -0,0 +1,221 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +#include "minehunt.h" + +void tilesPropAppend(QDeclarativeListProperty* prop, TileData* value) +{ + Q_UNUSED(prop); + Q_UNUSED(value); + return; //Append not supported +} + +int tilesPropCount(QDeclarativeListProperty* prop) +{ + return static_cast*>(prop->data)->count(); +} + +TileData* tilesPropAt(QDeclarativeListProperty* prop, int index) +{ + return static_cast*>(prop->data)->at(index); +} + +QDeclarativeListProperty MinehuntGame::tiles(){ + return QDeclarativeListProperty(this, &_tiles, &tilesPropAppend, + &tilesPropCount, &tilesPropAt, 0); +} + +MinehuntGame::MinehuntGame() +: numCols(9), numRows(9), playing(true), won(false) +{ + setObjectName("mainObject"); + srand(QTime(0,0,0).secsTo(QTime::currentTime())); + + //initialize array + for(int ii = 0; ii < numRows * numCols; ++ii) { + _tiles << new TileData; + } + reset(); + +} + +void MinehuntGame::setBoard() +{ + foreach(TileData* t, _tiles){ + t->setHasMine(false); + t->setHint(-1); + } + //place mines + int mines = nMines; + remaining = numRows*numCols-mines; + while ( mines ) { + int col = int((double(rand()) / double(RAND_MAX)) * numCols); + int row = int((double(rand()) / double(RAND_MAX)) * numRows); + + TileData* t = tile( row, col ); + + if (t && !t->hasMine()) { + t->setHasMine( true ); + mines--; + } + } + + //set hints + for (int r = 0; r < numRows; r++) + for (int c = 0; c < numCols; c++) { + TileData* t = tile(r, c); + if (t && !t->hasMine()) { + int hint = getHint(r,c); + t->setHint(hint); + } + } + + setPlaying(true); +} + +void MinehuntGame::reset() +{ + foreach(TileData* t, _tiles){ + t->unflip(); + t->setHasFlag(false); + } + nMines = 12; + nFlags = 0; + emit numMinesChanged(); + emit numFlagsChanged(); + setPlaying(false); + QTimer::singleShot(600,this, SLOT(setBoard())); +} + +int MinehuntGame::getHint(int row, int col) +{ + int hint = 0; + for (int c = col-1; c <= col+1; c++) + for (int r = row-1; r <= row+1; r++) { + TileData* t = tile(r, c); + if (t && t->hasMine()) + hint++; + } + return hint; +} + +bool MinehuntGame::flip(int row, int col) +{ + if(!playing) + return false; + + TileData *t = tile(row, col); + if (!t || t->hasFlag()) + return false; + + if(t->flipped()){ + int flags = 0; + for (int c = col-1; c <= col+1; c++) + for (int r = row-1; r <= row+1; r++) { + TileData *nearT = tile(r, c); + if(!nearT || nearT == t) + continue; + if(nearT->hasFlag()) + flags++; + } + if(!t->hint() || t->hint() != flags) + return false; + for (int c = col-1; c <= col+1; c++) + for (int r = row-1; r <= row+1; r++) { + TileData *nearT = tile(r, c); + if (nearT && !nearT->flipped() && !nearT->hasFlag()) { + flip( r, c ); + } + } + return true; + } + + t->flip(); + + if (t->hint() == 0) { + for (int c = col-1; c <= col+1; c++) + for (int r = row-1; r <= row+1; r++) { + TileData* t = tile(r, c); + if (t && !t->flipped()) { + flip( r, c ); + } + } + } + + if(t->hasMine()){ + for (int r = 0; r < numRows; r++)//Flip all other mines + for (int c = 0; c < numCols; c++) { + TileData* t = tile(r, c); + if (t && t->hasMine()) { + flip(r, c); + } + } + won = false; + hasWonChanged(); + setPlaying(false); + return true; + } + + remaining--; + if(!remaining){ + won = true; + hasWonChanged(); + setPlaying(false); + return true; + } + return true; +} + +bool MinehuntGame::flag(int row, int col) +{ + TileData *t = tile(row, col); + if(!t || !playing || t->flipped()) + return false; + + t->setHasFlag(!t->hasFlag()); + nFlags += (t->hasFlag()?1:-1); + emit numFlagsChanged(); + return true; +} diff --git a/examples/declarative/demos/minehunt/minehunt.h b/examples/declarative/demos/minehunt/minehunt.h new file mode 100644 index 00000000..cbde1a56 --- /dev/null +++ b/examples/declarative/demos/minehunt/minehunt.h @@ -0,0 +1,129 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include + +class TileData : public QObject +{ + Q_OBJECT +public: + TileData() : _hasFlag(false), _hasMine(false), _hint(-1), _flipped(false) {} + + Q_PROPERTY(bool hasFlag READ hasFlag WRITE setHasFlag NOTIFY hasFlagChanged) + bool hasFlag() const { return _hasFlag; } + + Q_PROPERTY(bool hasMine READ hasMine NOTIFY hasMineChanged) + bool hasMine() const { return _hasMine; } + + Q_PROPERTY(int hint READ hint NOTIFY hintChanged) + int hint() const { return _hint; } + + Q_PROPERTY(bool flipped READ flipped NOTIFY flippedChanged()) + bool flipped() const { return _flipped; } + + void setHasFlag(bool flag) {if(flag==_hasFlag) return; _hasFlag = flag; emit hasFlagChanged();} + void setHasMine(bool mine) {if(mine==_hasMine) return; _hasMine = mine; emit hasMineChanged();} + void setHint(int hint) { if(hint == _hint) return; _hint = hint; emit hintChanged(); } + void flip() { if (_flipped) return; _flipped = true; emit flippedChanged(); } + void unflip() { if(!_flipped) return; _flipped = false; emit flippedChanged(); } + +signals: + void flippedChanged(); + void hasFlagChanged(); + void hintChanged(); + void hasMineChanged(); + +private: + bool _hasFlag; + bool _hasMine; + int _hint; + bool _flipped; +}; + +class MinehuntGame : public QObject +{ + Q_OBJECT +public: + MinehuntGame(); + + Q_PROPERTY(QDeclarativeListProperty tiles READ tiles CONSTANT) + QDeclarativeListProperty tiles(); + + Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged) + bool isPlaying() {return playing;} + + Q_PROPERTY(bool hasWon READ hasWon NOTIFY hasWonChanged) + bool hasWon() {return won;} + + Q_PROPERTY(int numMines READ numMines NOTIFY numMinesChanged) + int numMines() const{return nMines;} + + Q_PROPERTY(int numFlags READ numFlags NOTIFY numFlagsChanged) + int numFlags() const{return nFlags;} + +public slots: + Q_INVOKABLE bool flip(int row, int col); + Q_INVOKABLE bool flag(int row, int col); + void setBoard(); + void reset(); + +signals: + void isPlayingChanged(); + void hasWonChanged(); + void numMinesChanged(); + void numFlagsChanged(); + +private: + bool onBoard( int r, int c ) const { return r >= 0 && r < numRows && c >= 0 && c < numCols; } + TileData *tile( int row, int col ) { return onBoard(row, col) ? _tiles[col+numRows*row] : 0; } + int getHint(int row, int col); + void setPlaying(bool b){if(b==playing) return; playing=b; emit isPlayingChanged();} + + QList _tiles; + int numCols; + int numRows; + bool playing; + bool won; + int remaining; + int nMines; + int nFlags; +}; diff --git a/examples/declarative/demos/minehunt/minehunt.pro b/examples/declarative/demos/minehunt/minehunt.pro new file mode 100644 index 00000000..f7c46ec7 --- /dev/null +++ b/examples/declarative/demos/minehunt/minehunt.pro @@ -0,0 +1,25 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/minehunt +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +HEADERS += minehunt.h +SOURCES += main.cpp minehunt.cpp +RESOURCES = minehunt.qrc + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/minehunt +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/minehunt/minehunt.qmlproject b/examples/declarative/demos/minehunt/minehunt.qmlproject new file mode 100644 index 00000000..1f8b659f --- /dev/null +++ b/examples/declarative/demos/minehunt/minehunt.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/minehunt" + } + JavaScriptFiles { + directory: "qml/minehunt" + } + ImageFiles { + directory: "qml/minehunt" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/minehunt/minehunt.qrc b/examples/declarative/demos/minehunt/minehunt.qrc new file mode 100644 index 00000000..4694beb1 --- /dev/null +++ b/examples/declarative/demos/minehunt/minehunt.qrc @@ -0,0 +1,19 @@ + + + qml/minehunt/minehunt.qml + qml/minehunt/MinehuntCore/Explosion.qml + qml/minehunt/MinehuntCore/Tile.qml + qml/minehunt/MinehuntCore/pics/background.png + qml/minehunt/MinehuntCore/pics/back.png + qml/minehunt/MinehuntCore/pics/bomb-color.png + qml/minehunt/MinehuntCore/pics/bomb.png + qml/minehunt/MinehuntCore/pics/face-sad.png + qml/minehunt/MinehuntCore/pics/face-smile-big.png + qml/minehunt/MinehuntCore/pics/face-smile.png + qml/minehunt/MinehuntCore/pics/flag-color.png + qml/minehunt/MinehuntCore/pics/flag.png + qml/minehunt/MinehuntCore/pics/front.png + qml/minehunt/MinehuntCore/pics/quit.png + qml/minehunt/MinehuntCore/pics/star.png + + diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Explosion.qml b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Explosion.qml new file mode 100644 index 00000000..8970b0ec --- /dev/null +++ b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Explosion.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 + +Item { + property bool explode : false + + Particles { + id: particles + width: 40 + height: 40 + lifeSpan: 1000 + lifeSpanDeviation: 0 + source: "pics/star.png" + count: 0 + angle: 270 + angleDeviation: 360 + velocity: 100 + velocityDeviation: 20 + z: 100 + } + states: State { name: "exploding"; when: explode + StateChangeScript {script: particles.burst(200); } + } +} diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Tile.qml b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Tile.qml new file mode 100644 index 00000000..79529ef3 --- /dev/null +++ b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/Tile.qml @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Flipable { + id: flipable + property int angle: 0 + + width: 40; height: 40 + transform: Rotation { origin.x: 20; origin.y: 20; axis.x: 1; axis.z: 0; angle: flipable.angle } + + front: Image { + source: "pics/front.png"; width: 40; height: 40 + + Image { + anchors.centerIn: parent + source: "pics/flag.png"; opacity: modelData.hasFlag + + Behavior on opacity { NumberAnimation {} } + } + } + + back: Image { + source: "pics/back.png" + width: 40; height: 40 + + Text { + anchors.centerIn: parent + text: modelData.hint; color: "white"; font.bold: true + opacity: !modelData.hasMine && modelData.hint > 0 + } + + Image { + anchors.centerIn: parent + source: "pics/bomb.png"; opacity: modelData.hasMine + } + + Explosion { id: expl } + } + + states: State { + name: "back"; when: modelData.flipped + PropertyChanges { target: flipable; angle: 180 } + } + + property real pauseDur: 250 + transitions: Transition { + SequentialAnimation { + ScriptAction { + script: { + var ret = Math.abs(flipable.x - field.clickx) + + Math.abs(flipable.y - field.clicky); + if (modelData.hasMine && modelData.flipped) + pauseDur = ret * 3 + else + pauseDur = ret + } + } + PauseAnimation { + duration: pauseDur + } + RotationAnimation { easing.type: Easing.InOutQuad } + ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } } + } + } + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton | Qt.RightButton + onClicked: { + field.clickx = flipable.x + field.clicky = flipable.y + var row = Math.floor(index / 9) + var col = index - (Math.floor(index / 9) * 9) + if (mouse.button == undefined || mouse.button == Qt.RightButton) { + flag(row, col) + } else { + flip(row, col) + } + } + onPressAndHold: { + field.clickx = flipable.x + field.clicky = flipable.y + var row = Math.floor(index / 9) + var col = index - (Math.floor(index / 9) * 9) + flag(row, col) + } + } +} diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/back.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/back.png new file mode 100644 index 00000000..f6b3f0b4 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/back.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/background.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/background.png new file mode 100644 index 00000000..3734a277 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/background.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png new file mode 100644 index 00000000..61ad0a92 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png new file mode 100644 index 00000000..a9925755 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png new file mode 100644 index 00000000..cf00aafe Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png new file mode 100644 index 00000000..f9c2335d Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png new file mode 100644 index 00000000..3d66d725 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png new file mode 100644 index 00000000..aadad0f1 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag.png new file mode 100644 index 00000000..39cde4df Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/flag.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/front.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/front.png new file mode 100644 index 00000000..834331bd Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/front.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/quit.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/quit.png new file mode 100644 index 00000000..b822057d Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/quit.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/star.png b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/star.png new file mode 100644 index 00000000..37723591 Binary files /dev/null and b/examples/declarative/demos/minehunt/qml/minehunt/MinehuntCore/pics/star.png differ diff --git a/examples/declarative/demos/minehunt/qml/minehunt/minehunt.qml b/examples/declarative/demos/minehunt/qml/minehunt/minehunt.qml new file mode 100644 index 00000000..92dba346 --- /dev/null +++ b/examples/declarative/demos/minehunt/qml/minehunt/minehunt.qml @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "MinehuntCore" + +Item { + id: field + property int clickx: 0 + property int clicky: 0 + + width: 450; height: 450 + + Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile } + + Grid { + anchors.horizontalCenter: parent.horizontalCenter + columns: 9; spacing: 1 + + Repeater { + id: repeater + model: tiles + delegate: Tile {} + } + } + + Row { + id: gamedata + x: 20; spacing: 20 + anchors.bottom: field.bottom; anchors.bottomMargin: 15 + + Image { + source: "MinehuntCore/pics/quit.png" + scale: quitMouse.pressed ? 0.8 : 1.0 + smooth: quitMouse.pressed + y: 10 + MouseArea { + id: quitMouse + anchors.fill: parent + anchors.margins: -20 + onClicked: Qt.quit() + } + } + Column { + spacing: 2 + Image { source: "MinehuntCore/pics/bomb-color.png" } + Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numMines } + } + + Column { + spacing: 2 + Image { source: "MinehuntCore/pics/flag-color.png" } + Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numFlags } + } + } + + Image { + anchors.bottom: field.bottom; anchors.bottomMargin: 15 + anchors.right: field.right; anchors.rightMargin: 20 + source: isPlaying ? 'MinehuntCore/pics/face-smile.png' : + hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png' + + MouseArea { anchors.fill: parent; onPressed: reset() } + } + Text { + anchors.centerIn: parent; width: parent.width - 20 + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + text: "Minehunt demo has to be compiled to run.\n\nPlease see README." + color: "white"; font.bold: true; font.pixelSize: 14 + visible: tiles == undefined + } + +} diff --git a/examples/declarative/demos/photoviewer/main.cpp b/examples/declarative/demos/photoviewer/main.cpp new file mode 100644 index 00000000..61ac2717 --- /dev/null +++ b/examples/declarative/demos/photoviewer/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/photoviewer/photoviewer.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/photoviewer/photoviewer.desktop b/examples/declarative/demos/photoviewer/photoviewer.desktop new file mode 100644 index 00000000..4246b9f3 --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=photoviewer +Exec=/opt/photoviewer/bin/photoviewer +Icon=photoviewer64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/photoviewer/photoviewer.pro b/examples/declarative/demos/photoviewer/photoviewer.pro new file mode 100644 index 00000000..ac052881 --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/photoviewer +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/photoviewer +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/photoviewer/photoviewer.qmlproject b/examples/declarative/demos/photoviewer/photoviewer.qmlproject new file mode 100644 index 00000000..025a3a8f --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/photoviewer" + } + JavaScriptFiles { + directory: "qml/photoviewer" + } + ImageFiles { + directory: "qml/photoviewer" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/photoviewer/photoviewer.svg b/examples/declarative/demos/photoviewer/photoviewer.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/photoviewer/photoviewer64.png b/examples/declarative/demos/photoviewer/photoviewer64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/photoviewer/photoviewer64.png differ diff --git a/examples/declarative/demos/photoviewer/photoviewer80.png b/examples/declarative/demos/photoviewer/photoviewer80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/photoviewer/photoviewer80.png differ diff --git a/examples/declarative/demos/photoviewer/photoviewer_harmattan.desktop b/examples/declarative/demos/photoviewer/photoviewer_harmattan.desktop new file mode 100644 index 00000000..2dced148 --- /dev/null +++ b/examples/declarative/demos/photoviewer/photoviewer_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=photoviewer +Exec=/usr/bin/single-instance /opt/photoviewer/bin/photoviewer +Icon=/usr/share/icons/hicolor/80x80/apps/photoviewer80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml new file mode 100644 index 00000000..696f1539 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Component { + id: albumDelegate + Package { + + Item { + Package.name: 'browser' + GridView { + id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21 + x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false + onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain) + } + } + + Item { + Package.name: 'fullscreen' + ListView { + id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal + width: mainWindow.width; height: mainWindow.height; interactive: false + onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain) + highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem + } + } + + Item { + Package.name: 'album' + id: albumWrapper; width: 210; height: 220 + + VisualDataModel { + id: visualModel; delegate: PhotoDelegate { } + model: RssModel { id: rssModel; tags: tag } + } + + BusyIndicator { + id: busyIndicator + anchors { centerIn: parent; verticalCenterOffset: -20 } + on: rssModel.status != XmlListModel.Ready + } + + PathView { + id: photosPathView; model: visualModel.parts.stack; pathItemCount: 5 + visible: !busyIndicator.visible + anchors.centerIn: parent; anchors.verticalCenterOffset: -30 + path: Path { + PathAttribute { name: 'z'; value: 9999.0 } + PathLine { x: 1; y: 1 } + PathAttribute { name: 'z'; value: 0.0 } + } + } + + MouseArea { + anchors.fill: parent + onClicked: mainWindow.editMode ? photosModel.remove(index) : albumWrapper.state = 'inGrid' + } + + Tag { + anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 } + frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode + onTagChanged: rssModel.tags = tag + onBackClicked: if (mainWindow.editMode) photosModel.remove(index); + } + + states: [ + State { + name: 'inGrid' + PropertyChanges { target: photosGridView; interactive: true } + PropertyChanges { target: albumsShade; opacity: 1 } + PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 } + }, + State { + name: 'fullscreen'; extend: 'inGrid' + PropertyChanges { target: photosGridView; interactive: false } + PropertyChanges { target: photosListView; interactive: true } + PropertyChanges { target: photosShade; opacity: 1 } + PropertyChanges { target: backButton; y: -backButton.height - 8 } + } + ] + + GridView.onAdd: NumberAnimation { + target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad + } + GridView.onRemove: SequentialAnimation { + PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } + NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad } + PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } + } + + transitions: [ + Transition { + from: '*'; to: 'inGrid' + SequentialAnimation { + NumberAnimation { properties: 'opacity'; duration: 250 } + PauseAnimation { duration: 350 } + NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad } + } + }, + Transition { + from: 'inGrid'; to: '*' + NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 } + } + ] + } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml new file mode 100644 index 00000000..7d5cd577 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.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/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml new file mode 100644 index 00000000..76d39afc --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property alias label: labelText.text + property color tint: "transparent" + signal clicked + + width: labelText.width + 70 ; height: labelText.height + 18 + + BorderImage { + anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } + source: 'images/box-shadow.png'; smooth: true + border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 + } + + Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true } + + Rectangle { + anchors.fill: container; color: container.tint; visible: container.tint != "" + opacity: 0.25; smooth: true + } + + Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true } + + MouseArea { + anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } + onClicked: container.clicked() + } +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml new file mode 100644 index 00000000..1edcd575 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property string label + signal clicked + signal labelChanged(string label) + + width: textInput.width + 70 ; height: textInput.height + 18 + + BorderImage { + anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } + source: 'images/box-shadow.png'; smooth: true + border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 + } + + Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true } + + TextInput { + id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true + Keys.onReturnPressed: { + container.labelChanged(textInput.text) + container.focus = true + } + Keys.onEnterPressed: { + container.labelChanged(textInput.text) + container.focus = true + } + Keys.onEscapePressed: { + textInput.text = container.label + container.focus = true + } + } + + Rectangle { + anchors.fill: container; border.color: "steelblue"; border.width: 4 + color: "transparent"; visible: textInput.focus; smooth: true + } + + MouseArea { + anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } + onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml new file mode 100644 index 00000000..cace0588 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml @@ -0,0 +1,188 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 +import "script/script.js" as Script + +Package { + Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z } + Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 } + Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 } + + Item { + width: 160; height: 153 + + Item { + id: photoWrapper + + property double randomAngle: Math.random() * (2 * 6 + 1) - 6 + property double randomAngle2: Math.random() * (2 * 6 + 1) - 6 + + x: 0; y: 0; width: 140; height: 133 + z: stackItem.PathView.z; rotation: photoWrapper.randomAngle + + BorderImage { + anchors { + fill: originalImage.status == Image.Ready ? border : placeHolder + leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 + } + source: 'images/box-shadow.png'; smooth: true + border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 + } + Rectangle { + id: placeHolder + + property int w: Script.getWidth(content) + property int h: Script.getHeight(content) + property double s: Script.calculateScale(w, h, photoWrapper.width) + + color: 'white'; anchors.centerIn: parent; smooth: true + width: w * s; height: h * s; visible: originalImage.status != Image.Ready + Rectangle { + color: "#878787"; smooth: true + anchors { fill: parent; topMargin: 3; bottomMargin: 3; leftMargin: 3; rightMargin: 3 } + } + } + Rectangle { + id: border; color: 'white'; anchors.centerIn: parent; smooth: true + width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6 + visible: !placeHolder.visible + } + BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready } + Image { + id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content); cache: false + fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height + } + Image { + id: hqImage; smooth: true; source: ""; visible: false; cache: false + fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height + } + Binding { + target: mainWindow; property: "downloadProgress"; value: hqImage.progress + when: listItem.ListView.isCurrentItem + } + Binding { + target: mainWindow; property: "imageLoading" + value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem + } + MouseArea { + width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage + onClicked: { + if (albumWrapper.state == 'inGrid') { + gridItem.GridView.view.currentIndex = index; + albumWrapper.state = 'fullscreen' + } else { + gridItem.GridView.view.currentIndex = index; + albumWrapper.state = 'inGrid' + } + } + } + + states: [ + State { + name: 'stacked'; when: albumWrapper.state == '' + ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 } + PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 } + }, + State { + name: 'inGrid'; when: albumWrapper.state == 'inGrid' + ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 } + }, + State { + name: 'fullscreen'; when: albumWrapper.state == 'fullscreen' + ParentChange { + target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0 + width: mainWindow.width; height: mainWindow.height + } + PropertyChanges { target: border; opacity: 0 } + PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true } + } + ] + + transitions: [ + Transition { + from: 'stacked'; to: 'inGrid' + SequentialAnimation { + PauseAnimation { duration: 10 * index } + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { + target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' + } + } + } + }, + Transition { + from: 'inGrid'; to: 'stacked' + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' } + } + }, + Transition { + from: 'inGrid'; to: 'fullscreen' + SequentialAnimation { + PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 } + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { + targets: [ photoWrapper, border ] + properties: 'x,y,width,height,opacity,rotation' + duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' + } + } + } + }, + Transition { + from: 'fullscreen'; to: 'inGrid' + ParentAnimation { + target: photoWrapper; via: foreground + NumberAnimation { + targets: [ photoWrapper, border ] + properties: 'x,y,width,height,rotation,opacity' + duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' + } + } + } + ] + } + } +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml new file mode 100644 index 00000000..6fe73021 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.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/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml new file mode 100644 index 00000000..02c73a36 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +XmlListModel { + property string tags : "" + + source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "") + query: "/feed/entry" + namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" + + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "content"; query: "content/string()" } + XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" } +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml new file mode 100644 index 00000000..af9e0fde --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.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/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png new file mode 100644 index 00000000..431af854 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png differ diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png new file mode 100644 index 00000000..664c2b14 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png differ diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png new file mode 100644 index 00000000..1847ab52 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png differ diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir new file mode 100644 index 00000000..d3c247f2 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir @@ -0,0 +1,8 @@ +AlbumDelegate AlbumDelegate.qml +PhotoDelegate PhotoDelegate.qml +ProgressBar ProgressBar.qml +RssModel RssModel.qml +BusyIndicator BusyIndicator.qml +EditableButton EditableButton.qml +Button Button.qml +Tag Tag.qml diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js new file mode 100644 index 00000000..e8ef93a8 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js @@ -0,0 +1,27 @@ +.pragma library + +function getWidth(string) { + return (string.match(/width=\"([0-9]+)\"/))[1] +} + +function getHeight(string) { + return (string.match(/height=\"([0-9]+)\"/))[1] +} + +function getImagePath(string) { + var pattern = /src=\"http:\/\/(\S+)\"/ + return (string.match(pattern))[1] +} + +function calculateScale(width, height, cellSize) { + var widthScale = (cellSize * 1.0) / width + var heightScale = (cellSize * 1.0) / height + var scale = 0 + + if (widthScale <= heightScale) { + scale = widthScale; + } else if (heightScale < widthScale) { + scale = heightScale; + } + return scale; +} diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/base.ts b/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/base.ts new file mode 100644 index 00000000..1accfd2f --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/base.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + + + + + photoviewer + + + Add + + + + + Edit + + + + + Back + + + + diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.qm b/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.qm new file mode 100644 index 00000000..c24fcbc4 Binary files /dev/null and b/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.qm differ diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.ts b/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.ts new file mode 100644 index 00000000..9f892db6 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/i18n/qml_fr.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + Supprimer + + + + photoviewer + + + Add + Ajouter + + + + Edit + Éditer + + + + Back + Retour + + + diff --git a/examples/declarative/demos/photoviewer/qml/photoviewer/photoviewer.qml b/examples/declarative/demos/photoviewer/qml/photoviewer/photoviewer.qml new file mode 100644 index 00000000..6c7285f7 --- /dev/null +++ b/examples/declarative/demos/photoviewer/qml/photoviewer/photoviewer.qml @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "PhotoViewerCore" + +Rectangle { + id: mainWindow + + property real downloadProgress: 0 + property bool imageLoading: false + property bool editMode: false + + width: 800; height: 480; color: "#d5d6d8" + + ListModel { + id: photosModel + ListElement { tag: "Flowers" } + ListElement { tag: "Wildlife" } + ListElement { tag: "Prague" } + } + + VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} } + + GridView { + id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220 + model: albumVisualModel.parts.album; visible: albumsShade.opacity != 1.0 + } + + Column { + spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 } + Button { + id: newButton; label: qsTr("Add"); rotation: 3 + anchors.horizontalCenter: parent.horizontalCenter + onClicked: { + mainWindow.editMode = false + photosModel.append( { tag: "" } ) + albumView.positionViewAtIndex(albumView.count - 1, GridView.Contain) + } + } + Button { + id: deleteButton; label: qsTr("Edit"); rotation: -2; + onClicked: mainWindow.editMode = !mainWindow.editMode + anchors.horizontalCenter: parent.horizontalCenter + } + Button { + id: quitButton; label: qsTr("Quit"); rotation: -2; + onClicked: Qt.quit() + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Rectangle { + id: albumsShade; color: mainWindow.color + width: parent.width; height: parent.height; opacity: 0.0 + } + + ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false } + + Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } + + Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 } + + ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false } + + Item { id: foreground; anchors.fill: parent } + + ProgressBar { + progress: mainWindow.downloadProgress; width: parent.width; height: 4 + anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0 + } +} diff --git a/examples/declarative/demos/rssnews/main.cpp b/examples/declarative/demos/rssnews/main.cpp new file mode 100644 index 00000000..d4066f73 --- /dev/null +++ b/examples/declarative/demos/rssnews/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/rssnews/rssnews.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/rssnews/qml/rssnews/content/BusyIndicator.qml b/examples/declarative/demos/rssnews/qml/rssnews/content/BusyIndicator.qml new file mode 100644 index 00000000..71e6c019 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews/content/BusyIndicator.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.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/declarative/demos/rssnews/qml/rssnews/content/CategoryDelegate.qml b/examples/declarative/demos/rssnews/qml/rssnews/content/CategoryDelegate.qml new file mode 100644 index 00000000..a1ad72c4 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews/content/CategoryDelegate.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: delegate + + width: delegate.ListView.view.width; height: 60 + + Text { + text: name + color: delegate.ListView.isCurrentItem ? "white" : "black" + font { family: "Helvetica"; pixelSize: 16; bold: true } + anchors { + left: parent.left; leftMargin: 15 + verticalCenter: parent.verticalCenter + } + } + + BusyIndicator { + scale: 0.6 + on: delegate.ListView.isCurrentItem && window.loading + anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter } + } + + Rectangle { + width: delegate.width; height: 1; color: "#cccccc" + anchors.bottom: delegate.bottom + visible: delegate.ListView.isCurrentItem ? false : true + } + Rectangle { + width: delegate.width; height: 1; color: "white" + visible: delegate.ListView.isCurrentItem ? false : true + } + + MouseArea { + anchors.fill: delegate + onClicked: { + delegate.ListView.view.currentIndex = index + window.currentFeed = feed + } + } +} diff --git a/examples/declarative/demos/rssnews/qml/rssnews/content/NewsDelegate.qml b/examples/declarative/demos/rssnews/qml/rssnews/content/NewsDelegate.qml new file mode 100644 index 00000000..3a3be14c --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews/content/NewsDelegate.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: delegate + height: column.height + 40 + width: delegate.ListView.view.width + + Column { + id: column + x: 20; y: 20 + width: parent.width - 40 + + Text { + id: titleText + text: title; width: parent.width; wrapMode: Text.WordWrap + font { bold: true; family: "Helvetica"; pointSize: 16 } + } + + Text { + id: descriptionText + width: parent.width; text: description + wrapMode: Text.WordWrap; font.family: "Helvetica" + } + } + + Rectangle { + width: parent.width; height: 1; color: "#cccccc" + anchors.bottom: parent.bottom + } +} diff --git a/examples/declarative/demos/rssnews/qml/rssnews/content/RssFeeds.qml b/examples/declarative/demos/rssnews/qml/rssnews/content/RssFeeds.qml new file mode 100644 index 00000000..c2285b25 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews/content/RssFeeds.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +ListModel { + id: rssFeeds + + ListElement { name: "Top Stories"; feed: "rss.news.yahoo.com/rss/topstories" } + ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" } + ListElement { name: "Europe"; feed: "rss.news.yahoo.com/rss/europe" } + ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" } + ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" } + ListElement { name: "Politics"; feed: "rss.news.yahoo.com/rss/politics" } + ListElement { name: "Business"; feed: "rss.news.yahoo.com/rss/business" } + ListElement { name: "Technology"; feed: "rss.news.yahoo.com/rss/tech" } + ListElement { name: "Entertainment"; feed: "rss.news.yahoo.com/rss/entertainment" } + ListElement { name: "Health"; feed: "rss.news.yahoo.com/rss/health" } + ListElement { name: "Science"; feed: "rss.news.yahoo.com/rss/science" } + ListElement { name: "Sports"; feed: "rss.news.yahoo.com/rss/sports" } +} diff --git a/examples/declarative/demos/rssnews/qml/rssnews/content/ScrollBar.qml b/examples/declarative/demos/rssnews/qml/rssnews/content/ScrollBar.qml new file mode 100644 index 00000000..a873bd3e --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews/content/ScrollBar.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + property variant scrollArea + property variant orientation: Qt.Vertical + + opacity: 0 + + function position() + { + var ny = 0; + if (container.orientation == Qt.Vertical) + ny = scrollArea.visibleArea.yPosition * container.height; + else + ny = scrollArea.visibleArea.xPosition * container.width; + if (ny > 2) return ny; else return 2; + } + + function size() + { + var nh, ny; + + if (container.orientation == Qt.Vertical) + nh = scrollArea.visibleArea.heightRatio * container.height; + else + nh = scrollArea.visibleArea.widthRatio * container.width; + + if (container.orientation == Qt.Vertical) + ny = scrollArea.visibleArea.yPosition * container.height; + else + ny = scrollArea.visibleArea.xPosition * container.width; + + if (ny > 3) { + var t; + if (container.orientation == Qt.Vertical) + t = Math.ceil(container.height - 3 - ny); + else + t = Math.ceil(container.width - 3 - ny); + if (nh > t) return t; else return nh; + } else return nh + ny; + } + + Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 } + + BorderImage { + source: "images/scrollbar.png" + border { left: 1; right: 1; top: 1; bottom: 1 } + x: container.orientation == Qt.Vertical ? 2 : position() + width: container.orientation == Qt.Vertical ? container.width - 4 : size() + y: container.orientation == Qt.Vertical ? position() : 2 + height: container.orientation == Qt.Vertical ? size() : container.height - 4 + } + + states: State { + name: "visible" + when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally + PropertyChanges { target: container; opacity: 1.0 } + } + + transitions: Transition { + from: "visible"; to: "" + NumberAnimation { properties: "opacity"; duration: 600 } + } +} diff --git a/examples/declarative/demos/rssnews/qml/rssnews/content/images/busy.png b/examples/declarative/demos/rssnews/qml/rssnews/content/images/busy.png new file mode 100644 index 00000000..664c2b14 Binary files /dev/null and b/examples/declarative/demos/rssnews/qml/rssnews/content/images/busy.png differ diff --git a/examples/declarative/demos/rssnews/qml/rssnews/content/images/scrollbar.png b/examples/declarative/demos/rssnews/qml/rssnews/content/images/scrollbar.png new file mode 100644 index 00000000..0228dcf9 Binary files /dev/null and b/examples/declarative/demos/rssnews/qml/rssnews/content/images/scrollbar.png differ diff --git a/examples/declarative/demos/rssnews/qml/rssnews/rssnews.qml b/examples/declarative/demos/rssnews/qml/rssnews/rssnews.qml new file mode 100644 index 00000000..e39e2f75 --- /dev/null +++ b/examples/declarative/demos/rssnews/qml/rssnews/rssnews.qml @@ -0,0 +1,111 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "content" + +Rectangle { + id: window + width: 800; height: 480 + + property string currentFeed: "rss.news.yahoo.com/rss/topstories" + property bool loading: feedModel.status == XmlListModel.Loading + + RssFeeds { id: rssFeeds } + + XmlListModel { + id: feedModel + source: "http://" + window.currentFeed + query: "/rss/channel/item" + + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "link"; query: "link/string()" } + XmlRole { name: "description"; query: "description/string()" } + } + + Row { + Rectangle { + width: 220; height: window.height + color: "#efefef" + + ListView { + focus: true + id: categories + anchors.fill: parent + model: rssFeeds + footer: quitButtonDelegate + delegate: CategoryDelegate {} + highlight: Rectangle { color: "steelblue" } + highlightMoveSpeed: 9999999 + } + ScrollBar { + scrollArea: categories; height: categories.height; width: 8 + anchors.right: categories.right + } + } + ListView { + id: list + width: window.width - 220; height: window.height + model: feedModel + delegate: NewsDelegate {} + } + } + Component { + id: quitButtonDelegate + Item { + width: categories.width; height: 60 + Text { + text: "Quit" + font { family: "Helvetica"; pixelSize: 16; bold: true } + anchors { + left: parent.left; leftMargin: 15 + verticalCenter: parent.verticalCenter + } + } + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } + } + ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right } + Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" } +} diff --git a/examples/declarative/demos/rssnews/rssnews.desktop b/examples/declarative/demos/rssnews/rssnews.desktop new file mode 100644 index 00000000..7d02ed5f --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=rssnews +Exec=/opt/rssnews/bin/rssnews +Icon=rssnews64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/rssnews/rssnews.pro b/examples/declarative/demos/rssnews/rssnews.pro new file mode 100644 index 00000000..5cdb9a95 --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/rssnews +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/rssnews +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/rssnews/rssnews.qmlproject b/examples/declarative/demos/rssnews/rssnews.qmlproject new file mode 100644 index 00000000..608be8d3 --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/rssnews" + } + JavaScriptFiles { + directory: "qml/rssnews" + } + ImageFiles { + directory: "qml/rssnews" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/rssnews/rssnews.svg b/examples/declarative/demos/rssnews/rssnews.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/rssnews/rssnews64.png b/examples/declarative/demos/rssnews/rssnews64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/rssnews/rssnews64.png differ diff --git a/examples/declarative/demos/rssnews/rssnews80.png b/examples/declarative/demos/rssnews/rssnews80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/rssnews/rssnews80.png differ diff --git a/examples/declarative/demos/rssnews/rssnews_harmattan.desktop b/examples/declarative/demos/rssnews/rssnews_harmattan.desktop new file mode 100644 index 00000000..df6303ff --- /dev/null +++ b/examples/declarative/demos/rssnews/rssnews_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=rssnews +Exec=/usr/bin/single-instance /opt/rssnews/bin/rssnews +Icon=/usr/share/icons/hicolor/80x80/apps/rssnews80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/samegame/main.cpp b/examples/declarative/demos/samegame/main.cpp new file mode 100644 index 00000000..27978404 --- /dev/null +++ b/examples/declarative/demos/samegame/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/samegame/samegame.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/BoomBlock.qml b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/BoomBlock.qml new file mode 100644 index 00000000..0e3b41cc --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/BoomBlock.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 +import Qt.labs.particles 1.0 + +Item { + id: block + property bool dying: false + property bool spawned: false + property int type: 0 + + Behavior on x { + enabled: spawned; + SpringAnimation{ spring: 2; damping: 0.2 } + } + Behavior on y { + SpringAnimation{ spring: 2; damping: 0.2 } + } + + Image { + id: img + source: { + if(type == 0){ + "pics/redStone.png"; + } else if(type == 1) { + "pics/blueStone.png"; + } else { + "pics/greenStone.png"; + } + } + opacity: 0 + Behavior on opacity { NumberAnimation { duration: 200 } } + anchors.fill: parent + } + + Particles { + id: particles + + width: 1; height: 1 + anchors.centerIn: parent + + emissionRate: 0 + lifeSpan: 700; lifeSpanDeviation: 600 + angle: 0; angleDeviation: 360; + velocity: 100; velocityDeviation: 30 + source: { + if(type == 0){ + "pics/redStar.png"; + } else if (type == 1) { + "pics/blueStar.png"; + } else { + "pics/greenStar.png"; + } + } + } + + states: [ + State { + name: "AliveState"; when: spawned == true && dying == false + PropertyChanges { target: img; opacity: 1 } + }, + + State { + name: "DeathState"; when: dying == true + StateChangeScript { script: particles.burst(50); } + PropertyChanges { target: img; opacity: 0 } + StateChangeScript { script: block.destroy(1000); } + } + ] +} diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/Button.qml b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/Button.qml new file mode 100644 index 00000000..1b9da226 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/Button.qml @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 + +Rectangle { + id: container + + property string text: "Button" + + signal clicked + + width: buttonLabel.width + 20; height: buttonLabel.height + 20 + smooth: true + border { width: 1; color: Qt.darker(activePalette.button) } + radius: 8 + color: activePalette.button + + gradient: Gradient { + GradientStop { + position: 0.0 + color: { + if (mouseArea.pressed) + return activePalette.dark + else + return activePalette.light + } + } + GradientStop { position: 1.0; color: activePalette.button } + } + + MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } + + Text { + id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText; font.pixelSize: 24 + } +} diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/Dialog.qml b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/Dialog.qml new file mode 100644 index 00000000..a7e02244 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/Dialog.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 + +Rectangle { + id: page + + property Item text: dialogText + + signal closed + signal opened + function forceClose() { + if(page.opacity == 0) + return; //already closed + page.closed(); + page.opacity = 0; + } + + function show(txt) { + page.opened(); + dialogText.text = txt; + page.opacity = 1; + } + + width: dialogText.width + 20; height: dialogText.height + 20 + color: "white" + border.width: 1 + opacity: 0 + visible: opacity > 0 + Behavior on opacity { + NumberAnimation { duration: 1000 } + } + + Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } + + MouseArea { anchors.fill: parent; onClicked: forceClose(); } +} + diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/background.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/background.png new file mode 100644 index 00000000..3734a277 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/background.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStar.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStar.png new file mode 100644 index 00000000..ff9588f8 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStar.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStone.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStone.png new file mode 100644 index 00000000..20e43c75 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/blueStone.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStar.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStar.png new file mode 100644 index 00000000..cd068547 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStar.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStone.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStone.png new file mode 100644 index 00000000..b568a190 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/greenStone.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStar.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStar.png new file mode 100644 index 00000000..0a4dffe5 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStar.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStone.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStone.png new file mode 100644 index 00000000..36b09a26 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/redStone.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/star.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/star.png new file mode 100644 index 00000000..defbde53 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/star.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/yellowStone.png b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/yellowStone.png new file mode 100644 index 00000000..b1ce7621 Binary files /dev/null and b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/pics/yellowStone.png differ diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/qmldir b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/qmldir new file mode 100644 index 00000000..e17b1f5d --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/qmldir @@ -0,0 +1,3 @@ +BoomBlock BoomBlock.qml +Button Button.qml +Dialog Dialog.qml diff --git a/examples/declarative/demos/samegame/qml/samegame/SamegameCore/samegame.js b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/samegame.js new file mode 100644 index 00000000..d7b827a1 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/SamegameCore/samegame.js @@ -0,0 +1,288 @@ +/* This script file handles the game logic */ + +var maxColumn = 10; +var maxRow = 15; +var maxIndex = maxColumn*maxRow; +var board = new Array(maxIndex); +var blockSrc = "SamegameCore/BoomBlock.qml"; +var scoresURL = ""; +var gameDuration; +var component = Qt.createComponent(blockSrc); +var highScoreBar = 0; + +// Index function used instead of a 2D array +function index(column, row) +{ + 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 startNewGame() +{ + // Delete blocks from previous game + for (var i = 0; i < maxIndex; i++) { + if (board[i] != null) + board[i].destroy(); + } + + // Calculate board size + maxColumn = Math.floor(gameCanvas.width/gameCanvas.blockSize); + maxRow = Math.floor(gameCanvas.height/gameCanvas.blockSize); + maxIndex = maxRow * maxColumn; + + // Close dialogs + nameInputDialog.forceClose(); + dialog.forceClose(); + + // Initialize Board + board = new Array(maxIndex); + gameCanvas.score = 0; + for (var column = 0; column < maxColumn; column++) { + for (var row = 0; row < maxRow; row++) { + board[index(column, row)] = null; + createBlock(column, row); + } + } + 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) +{ + 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; + gameCanvas.score += (fillFound - 1) * (fillFound - 1); + shuffleDown(); + victoryCheck(); +} + +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 victoryCheck() +{ + // Awards bonuses for no blocks left + var deservesBonus = true; + for (var column = maxColumn - 1; column >= 0; column--) + if (board[index(column, maxRow - 1)] != null) + deservesBonus = false; + if (deservesBonus) + gameCanvas.score += 500; + // Checks for game over + if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) { + gameDuration = new Date() - gameDuration; + if(gameCanvas.score > highScoreBar){ + nameInputDialog.show("You won! Please enter your name: "); + nameInputDialog.initialWidth = nameInputDialog.text.width + 20; + if (nameInputDialog.name == "") + nameInputDialog.width = nameInputDialog.initialWidth; + nameInputDialog.text.opacity = 0; // Just a spacer + }else{ + dialog.show("You won!"); + } + } +} + +// Only floods up and right, to see if it can find adjacent same-typed blocks +function floodMoveCheck(column, row, type) +{ + 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; + return floodMoveCheck(column + 1, row, myType) || + floodMoveCheck(column, row - 1, board[index(column, row)].type); +} + +function createBlock(column,row) +{ + // 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 == Component.Ready){ + var dynamicObject = component.createObject(gameCanvas, + {"type": Math.floor(Math.random() * 3), + "x": column*gameCanvas.blockSize, + "width": gameCanvas.blockSize, + "height": gameCanvas.blockSize}); + 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 initHighScoreBar() +{ + if(scoresURL != "") + return true;//don't query remote scores + var db = openDatabaseSync( + "SameGameScores", + "1.0", + "Local SameGame High Scores", + 100 + ); + db.transaction( + function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); + // Only show results for the current grid size + var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "' + + maxColumn + "x" + maxRow + '" ORDER BY score desc LIMIT 10'); + if(rs.rows.length < 10) + highScoreBar = 0; + else + highScoreBar = rs.rows.item(rs.rows.length - 1).score; + } + ); +} + +function saveHighScore(name) +{ + if (scoresURL != "") + sendHighScore(name); + // Offline storage + var db = openDatabaseSync( + "SameGameScores", + "1.0", + "Local SameGame High Scores", + 100 + ); + var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; + var data = [ + name, + gameCanvas.score, + maxColumn + "x" + maxRow, + Math.floor(gameDuration / 1000) + ]; + db.transaction( + function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); + tx.executeSql(dataStr, data); + + // Only show results for the current grid size + var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "' + + maxColumn + "x" + maxRow + '" ORDER BY score desc LIMIT 10'); + var r = "\nHIGH SCORES for this grid size\n\n" + for (var i = 0; i < rs.rows.length; i++) { + r += (i+1) + ". " + rs.rows.item(i).name + ' got ' + + rs.rows.item(i).score + ' points in ' + + rs.rows.item(i).time + ' seconds.\n'; + } + if(rs.rows.length == 10) + highScoreBar = rs.rows.item(9).score; + dialog.show(r); + } + ); +} + +function sendHighScore(name) +{ + var postman = new XMLHttpRequest() + var postData = "name=" + name + "&score=" + gameCanvas.score + + "&gridSize=" + maxColumn + "x" + maxRow + + "&time=" + Math.floor(gameDuration / 1000); + postman.open("POST", scoresURL, true); + postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + postman.onreadystatechange = function() { + if (postman.readyState == postman.DONE) { + dialog.show("Your score has been uploaded."); + } + } + postman.send(postData); +} diff --git a/examples/declarative/demos/samegame/qml/samegame/highscores/README b/examples/declarative/demos/samegame/qml/samegame/highscores/README new file mode 100644 index 00000000..eaa00fae --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/highscores/README @@ -0,0 +1 @@ +The SameGame example can interface with a simple PHP script to store XML high score data on a remote server. We do not have a publically accessible server available for this use, but if you have access to a PHP capable webserver you can copy the files (score_data.xml, score.php, score_style.xsl) to it and alter the highscore_server variable at the top of the samegame.js file to point to it. diff --git a/examples/declarative/demos/samegame/qml/samegame/highscores/score_data.xml b/examples/declarative/demos/samegame/qml/samegame/highscores/score_data.xml new file mode 100644 index 00000000..c3fd90d9 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/highscores/score_data.xml @@ -0,0 +1,2 @@ +1000000Alan the Tester0x00 +6213Alan12x1751 diff --git a/examples/declarative/demos/samegame/qml/samegame/highscores/score_style.xsl b/examples/declarative/demos/samegame/qml/samegame/highscores/score_style.xsl new file mode 100644 index 00000000..670354c9 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/highscores/score_style.xsl @@ -0,0 +1,28 @@ + + + + + SameGame High Scores + +

SameGame High Scores

+ + + + + + + + + + + + + + + + +
NameScoreGrid SizeTime, s
+ + +
+
diff --git a/examples/declarative/demos/samegame/qml/samegame/highscores/scores.php b/examples/declarative/demos/samegame/qml/samegame/highscores/scores.php new file mode 100644 index 00000000..3cceb2d7 --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/highscores/scores.php @@ -0,0 +1,34 @@ +"; + echo "SameGame High Scores"; + if($score > 0){#Sending in a new high score + $name = $_POST["name"]; + $grid = $_POST["gridSize"]; + $time = $_POST["time"]; + if($name == "") + $name = "Anonymous"; + //if($grid != "10x10"){ + //Need a standard, so as to reject others? + //} + $file = fopen("score_data.xml", "a"); #It's XML. Happy? + $ret = fwrite($file, "". $score . "" + . $name . "" . $grid . "" + . $time . "\n"); + echo "Your score has been recorded. Thanks for playing!"; + if($ret == False) + echo "
There was an error though, so don't expect to see that score again."; + }else{#Read high score list + #Now uses XSLT to display. So just print the file. With XML cruft added. + #Note that firefox at least won't apply the XSLT on a php file. So redirecting + $file = fopen("scores.xml", "w"); + $ret = fwrite($file, '' . "\n" + . '' . "\n" + . "\n" . file_get_contents("score_data.xml") . "\n"); + if($ret == False) + echo "There was an internal error. Sorry."; + else + echo ''; + } + echo ""; +?> diff --git a/examples/declarative/demos/samegame/qml/samegame/samegame.qml b/examples/declarative/demos/samegame/qml/samegame/samegame.qml new file mode 100644 index 00000000..db8016fc --- /dev/null +++ b/examples/declarative/demos/samegame/qml/samegame/samegame.qml @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 +import "SamegameCore" +import "SamegameCore/samegame.js" as Logic + +Rectangle { + id: screen + width: 490; height: 720 + property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos + + SystemPalette { id: activePalette } + + Item { + width: parent.width + anchors { top: parent.top; bottom: toolBar.top } + + Image { + id: background + anchors.fill: parent + source: "SamegameCore/pics/background.png" + fillMode: Image.PreserveAspectCrop + } + + Item { + id: gameCanvas + property int score: 0 + property int blockSize: 40 + + z: 20; anchors.centerIn: parent + width: parent.width - (parent.width % blockSize); + height: parent.height - (parent.height % blockSize); + + MouseArea { + anchors.fill: parent; onClicked: Logic.handleClick(mouse.x,mouse.y); + } + } + } + + Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + + Dialog { + id: nameInputDialog + + property int initialWidth: 0 + property alias name: nameInputText.text + + anchors.centerIn: parent + z: 22; + + Behavior on width { + NumberAnimation {} + enabled: nameInputDialog.initialWidth != 0 + } + + onClosed: { + if (nameInputText.text != "") + Logic.saveHighScore(nameInputText.text); + } + Text { + id: dialogText + anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter } + text: "You won! Please enter your name: " + } + MouseArea { + anchors.fill: parent + onClicked: { + if (nameInputText.text == "") + nameInputText.openSoftwareInputPanel(); + else + nameInputDialog.forceClose(); + } + } + + TextInput { + id: nameInputText + anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } + focus: visible + autoScroll: false + maximumLength: 24 + onTextChanged: { + var newWidth = nameInputText.width + dialogText.width + 40; + if ( (newWidth > nameInputDialog.width && newWidth < screen.width) + || (nameInputDialog.width > nameInputDialog.initialWidth) ) + nameInputDialog.width = newWidth; + } + onAccepted: { + nameInputDialog.forceClose(); + } + } + } + + Rectangle { + id: toolBar + width: parent.width; height: 58 + color: activePalette.window + anchors.bottom: screen.bottom + + Button { + id: newGameButton + anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + text: "New Game" + onClicked: Logic.startNewGame() + } + + Button { + visible: !inAnotherDemo + text: "Quit" + anchors { left: newGameButton.right; leftMargin: 3; verticalCenter: parent.verticalCenter } + onClicked: Qt.quit(); + } + + Text { + id: score + anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + text: "Score: " + gameCanvas.score + font.bold: true + font.pixelSize: 24 + color: activePalette.windowText + } + } +} diff --git a/examples/declarative/demos/samegame/samegame.desktop b/examples/declarative/demos/samegame/samegame.desktop new file mode 100644 index 00000000..18ad2d98 --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=samegame +Exec=/opt/samegame/bin/samegame +Icon=samegame64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/samegame/samegame.pro b/examples/declarative/demos/samegame/samegame.pro new file mode 100644 index 00000000..4df17a37 --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/samegame +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/samegame +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/samegame/samegame.qmlproject b/examples/declarative/demos/samegame/samegame.qmlproject new file mode 100644 index 00000000..c17ee1ee --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/samegame" + } + JavaScriptFiles { + directory: "qml/samegame" + } + ImageFiles { + directory: "qml/samegame" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/samegame/samegame.svg b/examples/declarative/demos/samegame/samegame.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/samegame/samegame.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/samegame/samegame64.png b/examples/declarative/demos/samegame/samegame64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/samegame/samegame64.png differ diff --git a/examples/declarative/demos/samegame/samegame80.png b/examples/declarative/demos/samegame/samegame80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/samegame/samegame80.png differ diff --git a/examples/declarative/demos/samegame/samegame_harmattan.desktop b/examples/declarative/demos/samegame/samegame_harmattan.desktop new file mode 100644 index 00000000..1f35b8e3 --- /dev/null +++ b/examples/declarative/demos/samegame/samegame_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=samegame +Exec=/usr/bin/single-instance /opt/samegame/bin/samegame +Icon=/usr/share/icons/hicolor/80x80/apps/samegame80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/snake/main.cpp b/examples/declarative/demos/snake/main.cpp new file mode 100644 index 00000000..cea869c1 --- /dev/null +++ b/examples/declarative/demos/snake/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/snake/snake.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/snake/qml/snake/content/Button.qml b/examples/declarative/demos/snake/qml/snake/content/Button.qml new file mode 100644 index 00000000..322431d3 --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/Button.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: container + + signal clicked + property string text: "Button" + + color: activePalette.button; smooth: true + width: txtItem.width + 20; height: txtItem.height + 6 + border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; + + gradient: Gradient { + GradientStop { + id: topGrad; position: 0.0 + color: if (mr.pressed) { activePalette.dark } else { activePalette.light } } + GradientStop { position: 1.0; color: activePalette.button } + } + + MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() } + + Text { + id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText + } +} diff --git a/examples/declarative/demos/snake/qml/snake/content/Cookie.qml b/examples/declarative/demos/snake/qml/snake/content/Cookie.qml new file mode 100644 index 00000000..d101445a --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/Cookie.qml @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 + +Item { + id: root + property bool dying: false + property int row; + property int column; + x: margin + column * gridSize + y: margin + row * gridSize + + width: gridSize + height: gridSize + property int value : 1; + + Image { + id: img + anchors.fill: parent + source: "pics/cookie.png" + opacity: 0 + Text { + font.bold: true + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + text: value + } + } + + Particles { id: particles + width:1; height:1; anchors.centerIn: parent; + emissionRate: 0; + lifeSpan: 700; lifeSpanDeviation: 600; + angle: 0; angleDeviation: 360; + velocity: 100; velocityDeviation:30; + source: "pics/yellowStar.png"; + } + + states: [ + State{ name: "AliveState"; when: dying == false + PropertyChanges { target: img; opacity: 1 } + }, + State{ name: "DeathState"; when: dying == true + StateChangeScript { script: particles.burst(50); } + PropertyChanges { target: img; opacity: 0 } + } + ] + transitions: [ + Transition { + NumberAnimation { target: img; property: "opacity"; duration: 100 } + } + ] +} diff --git a/examples/declarative/demos/snake/qml/snake/content/HighScoreModel.qml b/examples/declarative/demos/snake/qml/snake/content/HighScoreModel.qml new file mode 100644 index 00000000..c9a81831 --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/HighScoreModel.qml @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +// Models a high score table. +// +// Use this component like this: +// +// HighScoreModel { +// id: highScores +// game: "MyCoolGame" +// } +// +// Then use either use the top-score properties: +// +// Text { text: "HI: " + highScores.topScore } +// +// or, use the model in a view: +// +// ListView { +// model: highScore +// delegate: Component { +// ... player ... score ... +// } +// } +// +// Add new scores via: +// +// saveScore(newScore) +// +// or: +// +// savePlayerScore(playerName,newScore) +// +// The best maxScore scores added by this method will be retained in an SQL database, +// and presented in the model and in the topScore/topPlayer properties. +// + +ListModel { + id: model + property string game: "" + property int topScore: 0 + property string topPlayer: "" + property int maxScores: 10 + + function __db() + { + return openDatabaseSync("HighScoreModel", "1.0", "Generic High Score Functionality for QML", 1000000); + } + function __ensureTables(tx) + { + tx.executeSql('CREATE TABLE IF NOT EXISTS HighScores(game TEXT, score INT, player TEXT)', []); + } + + function fillModel() { + __db().transaction( + function(tx) { + __ensureTables(tx); + var rs = tx.executeSql("SELECT score,player FROM HighScores WHERE game=? ORDER BY score DESC", [game]); + model.clear(); + if (rs.rows.length > 0) { + topScore = rs.rows.item(0).score + topPlayer = rs.rows.item(0).player + for (var i=0; i maxScores) + tx.executeSql("DELETE FROM HighScores WHERE game=? AND score <= ?", + [game, rs.rows.item(maxScores).score]); + } + } + ) + } + + function savePlayerScore(player,score) { + __db().transaction( + function(tx) { + __ensureTables(tx); + tx.executeSql("INSERT INTO HighScores VALUES(?,?,?)", [game,score,player]); + fillModel(); + } + ) + } + + function saveScore(score) { + savePlayerScore("player",score); + } + + function clearScores() { + __db().transaction( + function(tx) { + tx.executeSql("DELETE FROM HighScores WHERE game=?", [game]); + fillModel(); + } + ) + } + + Component.onCompleted: { fillModel() } +} diff --git a/examples/declarative/demos/snake/qml/snake/content/Link.qml b/examples/declarative/demos/snake/qml/snake/content/Link.qml new file mode 100644 index 00000000..f5658e95 --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/Link.qml @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import Qt.labs.particles 1.0 + +Item { id:link + property bool dying: false + property bool spawned: false + property int type: 0 + property int row: 0 + property int column: 0 + property int rotation; + + width: 40; + height: 40 + + x: margin - 3 + gridSize * column + y: margin - 3 + gridSize * row + Behavior on x { NumberAnimation { duration: spawned ? heartbeatInterval : 0} } + Behavior on y { NumberAnimation { duration: spawned ? heartbeatInterval : 0 } } + + + Item { + id: img + anchors.fill: parent + Image { + source: { + if(type == 1) { + "pics/blueStone.png"; + } else if (type == 2) { + "pics/head.png"; + } else { + "pics/redStone.png"; + } + } + + transform: Rotation { + id: actualImageRotation + origin.x: width/2; origin.y: height/2; + angle: rotation * 90 + Behavior on angle { + RotationAnimation{ + direction: RotationAnimation.Shortest + duration: spawned ? 200 : 0 + } + } + } + } + + Image { + source: "pics/stoneShadow.png" + } + + opacity: 0 + } + + + Particles { id: particles + width:1; height:1; anchors.centerIn: parent; + emissionRate: 0; + lifeSpan: 700; lifeSpanDeviation: 600; + angle: 0; angleDeviation: 360; + velocity: 100; velocityDeviation:30; + source: { + if(type == 1){ + "pics/blueStar.png"; + } else { + "pics/redStar.png"; + } + } + } + + states: [ + State{ name: "AliveState"; when: spawned == true && dying == false + PropertyChanges { target: img; opacity: 1 } + }, + State{ name: "DeathState"; when: dying == true + StateChangeScript { script: particles.burst(50); } + PropertyChanges { target: img; opacity: 0 } + } + ] + + transitions: [ + Transition { + NumberAnimation { target: img; property: "opacity"; duration: 200 } + } + ] + +} diff --git a/examples/declarative/demos/snake/qml/snake/content/Skull.qml b/examples/declarative/demos/snake/qml/snake/content/Skull.qml new file mode 100644 index 00000000..4242b708 --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/Skull.qml @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + property bool spawned: false + property int row; + property int column; + property int verticalMovement; + property int horizontalMovement; + + x: margin + column * gridSize + 2 + y: margin + row * gridSize - 3 + Behavior on x { NumberAnimation { duration: spawned ? halfbeatInterval : 0} } + Behavior on y { NumberAnimation { duration: spawned ? halfbeatInterval : 0 } } + + opacity: spawned ? 1 : 0 + Behavior on opacity { NumberAnimation { duration: 200 } } + + source: "pics/skull.png" + width: 24 + height: 40 +} diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/README b/examples/declarative/demos/snake/qml/snake/content/pics/README new file mode 100644 index 00000000..0215132c --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/pics/README @@ -0,0 +1 @@ +snake.jpg: This image is based on the picture "Eastern Green Mamba.jpg" from the free media databse Wikimedia Commons and is published under the terms of the GNU Free Documentation License. The original picture was taken by Danleo. diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/background.png b/examples/declarative/demos/snake/qml/snake/content/pics/background.png new file mode 100644 index 00000000..72dffaa8 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/background.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/blueStar.png b/examples/declarative/demos/snake/qml/snake/content/pics/blueStar.png new file mode 100644 index 00000000..ba7acabd Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/blueStar.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/blueStone.png b/examples/declarative/demos/snake/qml/snake/content/pics/blueStone.png new file mode 100644 index 00000000..356affdd Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/blueStone.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/cookie.png b/examples/declarative/demos/snake/qml/snake/content/pics/cookie.png new file mode 100644 index 00000000..aec2957f Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/cookie.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/eyes.svg b/examples/declarative/demos/snake/qml/snake/content/pics/eyes.svg new file mode 100644 index 00000000..10786927 --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/pics/eyes.svg @@ -0,0 +1,118 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/head.png b/examples/declarative/demos/snake/qml/snake/content/pics/head.png new file mode 100644 index 00000000..550e0026 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/head.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/head.svg b/examples/declarative/demos/snake/qml/snake/content/pics/head.svg new file mode 100644 index 00000000..3bf0bd2f --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/pics/head.svg @@ -0,0 +1,134 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/pause.png b/examples/declarative/demos/snake/qml/snake/content/pics/pause.png new file mode 100644 index 00000000..056d97dd Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/pause.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/redStar.png b/examples/declarative/demos/snake/qml/snake/content/pics/redStar.png new file mode 100644 index 00000000..cd068547 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/redStar.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/redStone.png b/examples/declarative/demos/snake/qml/snake/content/pics/redStone.png new file mode 100644 index 00000000..9bb7fe42 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/redStone.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/skull.png b/examples/declarative/demos/snake/qml/snake/content/pics/skull.png new file mode 100644 index 00000000..63186167 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/skull.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/snake.jpg b/examples/declarative/demos/snake/qml/snake/content/pics/snake.jpg new file mode 100644 index 00000000..e91a784f Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/snake.jpg differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/star.png b/examples/declarative/demos/snake/qml/snake/content/pics/star.png new file mode 100644 index 00000000..defbde53 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/star.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/stoneShadow.png b/examples/declarative/demos/snake/qml/snake/content/pics/stoneShadow.png new file mode 100644 index 00000000..1bd56afd Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/stoneShadow.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/yellowStar.png b/examples/declarative/demos/snake/qml/snake/content/pics/yellowStar.png new file mode 100644 index 00000000..52fb9c4b Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/yellowStar.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/pics/yellowStone.png b/examples/declarative/demos/snake/qml/snake/content/pics/yellowStone.png new file mode 100644 index 00000000..c56124a8 Binary files /dev/null and b/examples/declarative/demos/snake/qml/snake/content/pics/yellowStone.png differ diff --git a/examples/declarative/demos/snake/qml/snake/content/snake.js b/examples/declarative/demos/snake/qml/snake/content/snake.js new file mode 100644 index 00000000..837b82ad --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/content/snake.js @@ -0,0 +1,316 @@ + +var snake = new Array; +var board = new Array; +var links = new Array; +var scheduledDirections = new Array; +var numRows = 1; +var numColumns = 1; +var linkComponent = Qt.createComponent("content/Link.qml"); // XXX should resolve relative to script, not component +var cookieComponent = Qt.createComponent("content/Cookie.qml"); +var cookie; +var linksToGrow = 0; +var linksToDie = 0; +var waitForCookie = 0; +var growType = 0; +var skullMovementsBeforeDirectionChange = 0; + + +function rand(n) +{ + return (Math.floor(Math.random() * n)); +} + +function scheduleDirection(dir) +{ + if (state == "starting") { + direction = dir; + headDirection = direction; + head.rotation = headDirection; + } else if (state == "running"){ + direction = dir; + if(scheduledDirections[scheduledDirections.length-1]!=direction) + scheduledDirections.push(direction); + } +} + +function startNewGame() +{ + if (state == "starting") { + return; + } + + if (activeGame) { + endGame(); + startNewGameTimer.running = true; + return; + } + + state = "starting"; + + numRows = numRowsAvailable; + numColumns = numColumnsAvailable; + board = new Array(numRows * numColumns); + snake = new Array; + scheduledDirections = new Array; + growType = 0; + + skull.z = numRows * numColumns + 1; + + for (var i = 0; i < numRows * numColumns; ++i) { + if (i < links.length) { + var link = links[i]; + link.spawned = false; + link.dying = false; + } else { + if(linkComponent.status != Component.Ready) { + if(linkComponent.status == Component.Error) + console.log(linkComponent.errorString()); + else + console.log("Still loading linkComponent"); + continue;//TODO: Better error handling? + } + var link = linkComponent.createObject(playfield); + link.z = numRows * numColumns + 1 - i; + link.type = i == 0 ? 2 : 0; + link.spawned = false; + link.dying = false; + links.push(link); + } + } + + head = links[0]; + snake.push(head); + head.row = numRows/2 -1; + head.column = numColumns/2 -1; + head.spawned = true; + + linksToGrow = 5; + linksToDie = 0; + waitForCookie = 5; + score = 0; + startHeartbeatTimer.running = true; +} + +function endGame() +{ + activeGame = false; + for(var i in snake) + snake[i].dying = true; + if (cookie) { + cookie.dying = true; + cookie = 0; + } + lastScore = score; + highScores.saveScore(lastScore); + state = ""; +} + +function move() { + + if (!head) + return; + + var dir = direction; + + if (scheduledDirections.length) { + dir = scheduledDirections.shift(); + } + + if (state == "starting") { + var turn = (dir - headDirection); + head.rotation += turn == -3 ? 1 : (turn == 3 ? -1 : turn ); + headDirection = dir; + return; + } + + var row = head.row; + var column = head.column; + + if (dir == 0) { + row = row - 1; + } else if (dir == 1) { + column = column + 1 + } else if (dir == 2) { + row = row + 1; + } else if (dir == 3) { + column = column - 1; + } + + //validate the new position + if (row < 0 || row >= numRows + || column < 0 || column >= numColumns + || (row == skull.row && column == skull.column) + || !isFree(row, column)) { + var turn = (dir - headDirection); + head.rotation += turn == -3 ? 1 : (turn == 3 ? -1 : turn ); + headDirection = dir; + endGame(); + return; + } + + var newLink; + if (linksToGrow > 0) { + --linksToGrow; + newLink = links[snake.length]; + newLink.spawned = false; + newLink.rotation = snake[snake.length-1].rotation; + newLink.type = growType; + newLink.dying = false; + snake.push(newLink); + } else { + var lastLink = snake[snake.length-1]; + board[lastLink.row * numColumns + lastLink.column] = undefined; + } + + if (waitForCookie > 0) { + if (--waitForCookie == 0) + createCookie(cookie? (cookie.value+1) : 1); + } + + for (var i = snake.length-1; i > 0; --i) { + snake[i].row = snake[i-1].row; + snake[i].column = snake[i-1].column; + snake[i].rotation = snake[i-1].rotation; + } + + if (newLink) { + newLink.spawned = true; + } + + // move the head + head.row = row; + head.column = column; + board[row * numColumns + column] = head; + + var turn = (dir - headDirection); + head.rotation += turn == -3 ? 1 : (turn == 3 ? -1 : turn ); + headDirection = dir; + + var value = testCookie(row, column); + if (value > 0) { + linksToGrow += value; + score += value; + } +} + +function isFree(row, column) +{ + return board[row * numColumns + column] == undefined; +} + +function isHead(row, column) +{ + return head.column == column && head.row == row; +} + +function testCookie(row, column) +{ + if (cookie && !cookie.dying && cookie.row == row && cookie.column == column) { + var value = cookie.value; + waitForCookie = value; + growType = snake[snake.length-1].type == 1 ? 0 : 1; + cookie.dying = true; + cookie.z = numRows * numColumns + 2; + return value; + } + return 0; +} + +function moveSkull() +{ + + if (linksToDie > 0) { + --linksToDie; + var link = snake.pop(); + link.dying = true; + board[link.row * numColumns + link.column] = undefined; + if (score > 0) + --score; + if (snake.length == 0) { + endGame(); + return; + } + } + + var row = skull.row; + var column = skull.column; + if (isHead(row, column)) { + endGame(); + return; + } + row += skull.verticalMovement; + column += skull.horizontalMovement; + + var attempts = 4; + + while (skullMovementsBeforeDirectionChange == 0 || row < 0 || row >= numRows + || column < 0 || column >= numColumns + || (!isFree(row, column) && !isHead(row, column))) { + var d = rand(8); + skull.verticalMovement = 0; + skull.horizontalMovement = 0; + skullMovementsBeforeDirectionChange = rand(20)+1; + if (d == 0) { + skull.verticalMovement = -1 + } else if (d == 1) { + skull.horizontalMovement = -1; + } else if (d == 2) { + skull.verticalMovement = 1 + } else if (d == 3){ + skull.horizontalMovement = 1; + } else if (cookie) { + var rd = cookie.row - skull.row; + var rc = cookie.column - skull.column; + if (Math.abs(rd) > Math.abs(rc)) { + skull.verticalMovement = rd > 0 ? 1 : -1; + skullMovementsBeforeDirectionChange = Math.abs(rd); + } else { + skull.horizontalMovement= rc > 0 ? 1 : -1; + skullMovementsBeforeDirectionChange = Math.abs(rc); + } + } + row = skull.row + skull.verticalMovement; + column = skull.column + skull.horizontalMovement; + if (--attempts == 0) + return; + } + + skull.row = row; + skull.column = column; + --skullMovementsBeforeDirectionChange; + var value = testCookie(row, column); + if (value > 0) + linksToDie += value/2; + + if (isHead(row, column)) + endGame(); +} + +function createCookie(value) { + if (numRows * numColumns - snake.length < 10) + return; + + var column = rand(numColumns); + var row = rand(numRows); + while (!isFree(row, column)) { + column++; + if (column == numColumns) { + column = 0; + row++; + if (row == numRows) + row = 0; + } + } + + if(cookieComponent.status != Component.Ready) { + if(cookieComponent.status == Component.Error) + console.log(cookieComponent.errorString()); + else + console.log("Still loading cookieComponent"); + return;//TODO: Better error handling? + } + cookie = cookieComponent.createObject(head.parent); + cookie.value = value; + cookie.row = row; + cookie.column = column; +} diff --git a/examples/declarative/demos/snake/qml/snake/snake.qml b/examples/declarative/demos/snake/qml/snake/snake.qml new file mode 100644 index 00000000..b5e386d6 --- /dev/null +++ b/examples/declarative/demos/snake/qml/snake/snake.qml @@ -0,0 +1,272 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "content" as Content +import "content/snake.js" as Logic + +Rectangle { + id: screen; + SystemPalette { id: activePalette } + color: activePalette.window + property bool activeGame: false + + property int gridSize : 34 + property int margin: 4 + property int numRowsAvailable: Math.floor((height-32-2*margin)/gridSize) + property int numColumnsAvailable: Math.floor((width-2*margin)/gridSize) + + property int lastScore : 0 + + property int score: 0; + property int heartbeatInterval: 200 + property int halfbeatInterval: 160 + + width: 480 + height: 750 + + property int direction + property int headDirection + + property variant head; + + Content.HighScoreModel { + id: highScores + game: "Snake" + } + + Timer { + id: heartbeat; + interval: heartbeatInterval; + running: activeGame + repeat: true + onTriggered: { Logic.move() } + } + Timer { + id: halfbeat; + interval: halfbeatInterval; + repeat: true + running: heartbeat.running + onTriggered: { Logic.moveSkull() } + } + Timer { + id: startNewGameTimer; + interval: 700; + onTriggered: { Logic.startNewGame(); } + } + + Timer { + id: startHeartbeatTimer; + interval: 1000 ; + onTriggered: { state = "running"; activeGame = true; } + } + + Image{ + id: pauseDialog + z: 1 + source: "content/pics/pause.png" + anchors.centerIn: parent; + //opacity is deliberately not animated + opacity: activeGame && !Qt.application.active + } + + Image { + + Image { + id: title + source: "content/pics/snake.jpg" + fillMode: Image.PreserveAspectCrop + anchors.fill: parent + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + Column { + spacing: 140 + anchors.verticalCenter: parent.verticalCenter; + anchors.left: parent.left; + anchors.right: parent.right; + + Text { + color: "white" + font.pointSize: 48 + font.italic: true; + font.bold: true; + text: "Snake" + anchors.horizontalCenter: parent.horizontalCenter; + } + + Text { + color: "white" + font.pointSize: 24 + anchors.horizontalCenter: parent.horizontalCenter; + //horizontalAlignment: Text.AlignHCenter + text: "Last Score:\t" + lastScore + "\nHighscore:\t" + highScores.topScore; + } + } + } + + source: "content/pics/background.png" + fillMode: Image.PreserveAspectCrop + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: toolbar.top + + Rectangle { + id: playfield + border.width: 1 + border.color: "white" + color: "transparent" + anchors.horizontalCenter: parent.horizontalCenter + y: (screen.height - 32 - height)/2; + width: numColumnsAvailable * gridSize + 2*margin + height: numRowsAvailable * gridSize + 2*margin + + + Content.Skull { + id: skull + } + + MouseArea { + anchors.fill: parent + onPressed: { + if (screen.state == "") { + Logic.startNewGame(); + return; + } + if (direction == 0 || direction == 2) + Logic.scheduleDirection((mouseX > (head.x + head.width/2)) ? 1 : 3); + else + Logic.scheduleDirection((mouseY > (head.y + head.height/2)) ? 2 : 0); + } + } + } + + } + + Rectangle { + id: progressBar + opacity: 0 + Behavior on opacity { NumberAnimation { duration: 200 } } + color: "transparent" + border.width: 2 + border.color: "#221edd" + x: 50 + y: 50 + width: 200 + height: 30 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: 40 + + Rectangle { + id: progressIndicator + color: "#221edd"; + width: 0; + height: 30; + } + } + + Rectangle { + id: toolbar + color: activePalette.window + height: 32; width: parent.width + anchors.bottom: screen.bottom + + Content.Button { + id: btnA; text: "New Game"; onClicked: Logic.startNewGame(); + anchors.left: parent.left; anchors.leftMargin: 3 + anchors.verticalCenter: parent.verticalCenter + } + + Content.Button { + text: "Quit" + anchors { left: btnA.right; leftMargin: 3; verticalCenter: parent.verticalCenter } + onClicked: Qt.quit(); + } + + Text { + color: activePalette.text + text: "Score: " + score; font.bold: true + anchors.right: parent.right; anchors.rightMargin: 3 + anchors.verticalCenter: parent.verticalCenter + } + } + + focus: true + Keys.onSpacePressed: Logic.startNewGame(); + Keys.onLeftPressed: if (state == "starting" || direction != 1) Logic.scheduleDirection(3); + Keys.onRightPressed: if (state == "starting" || direction != 3) Logic.scheduleDirection(1); + Keys.onUpPressed: if (state == "starting" || direction != 2) Logic.scheduleDirection(0); + Keys.onDownPressed: if (state == "starting" || direction != 0) Logic.scheduleDirection(2); + + states: [ + State { + name: "starting" + PropertyChanges {target: progressIndicator; width: 200} + PropertyChanges {target: title; opacity: 0} + PropertyChanges {target: progressBar; opacity: 1} + }, + State { + name: "running" + PropertyChanges {target: progressIndicator; width: 200} + PropertyChanges {target: title; opacity: 0} + PropertyChanges {target: skull; row: 0; column: 0; } + PropertyChanges {target: skull; spawned: 1} + } + ] + + transitions: [ + Transition { + from: "*" + to: "starting" + NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 } + NumberAnimation { property: "opacity"; duration: 200 } + }, + Transition { + to: "starting" + NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 } + NumberAnimation { property: "opacity"; duration: 200 } + } + ] + +} diff --git a/examples/declarative/demos/snake/snake.desktop b/examples/declarative/demos/snake/snake.desktop new file mode 100644 index 00000000..fef60907 --- /dev/null +++ b/examples/declarative/demos/snake/snake.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=snake +Exec=/opt/snake/bin/snake +Icon=snake64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/snake/snake.pro b/examples/declarative/demos/snake/snake.pro new file mode 100644 index 00000000..59b17747 --- /dev/null +++ b/examples/declarative/demos/snake/snake.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/snake +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/snake +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/snake/snake.qmlproject b/examples/declarative/demos/snake/snake.qmlproject new file mode 100644 index 00000000..431d2a9e --- /dev/null +++ b/examples/declarative/demos/snake/snake.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/snake" + } + JavaScriptFiles { + directory: "qml/snake" + } + ImageFiles { + directory: "qml/snake" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/snake/snake.svg b/examples/declarative/demos/snake/snake.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/snake/snake.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/snake/snake64.png b/examples/declarative/demos/snake/snake64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/snake/snake64.png differ diff --git a/examples/declarative/demos/snake/snake80.png b/examples/declarative/demos/snake/snake80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/snake/snake80.png differ diff --git a/examples/declarative/demos/snake/snake_harmattan.desktop b/examples/declarative/demos/snake/snake_harmattan.desktop new file mode 100644 index 00000000..10b0f792 --- /dev/null +++ b/examples/declarative/demos/snake/snake_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=snake +Exec=/usr/bin/single-instance /opt/snake/bin/snake +Icon=/usr/share/icons/hicolor/80x80/apps/snake80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/twitter/main.cpp b/examples/declarative/demos/twitter/main.cpp new file mode 100644 index 00000000..0a7a07f9 --- /dev/null +++ b/examples/declarative/demos/twitter/main.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmlapplicationviewer.h" +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + QmlApplicationViewer viewer; + viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); + viewer.setMainQmlFile(QLatin1String("qml/twitter/twitter.qml")); + viewer.showExpanded(); + + return app.exec(); +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml new file mode 100644 index 00000000..794ba267 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Button.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: container + + signal clicked + + property string text + property bool keyUsing: false + + BorderImage { + id: buttonImage + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + BorderImage { + id: pressed + opacity: 0 + source: "images/toolbutton.sci" + width: container.width; height: container.height + } + MouseArea { + id: mouseRegion + anchors.fill: buttonImage + onClicked: { container.clicked(); } + } + Text { + id: btnText + color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";} + anchors.centerIn: buttonImage; font.bold: true + text: container.text; style: Text.Raised; styleColor: "black" + font.pixelSize: 12 + } + states: [ + State { + name: "Pressed" + when: mouseRegion.pressed == true + PropertyChanges { target: pressed; opacity: 1 } + }, + State { + name: "Focused" + when: container.activeFocus == true + PropertyChanges { target: btnText; color: "#FFFFFF" } + } + ] + transitions: Transition { + ColorAnimation { target: btnText; } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml new file mode 100644 index 00000000..08a01c09 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/FatDelegate.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Component { + id: listDelegate + Item { + id: wrapper; width: wrapper.ListView.view.width; height: if(txt.height > 60){txt.height+10}else{60} //50+5+5 + function handleLink(link){ + if(link.slice(0,3) == 'app'){ + screen.setUser(link.slice(7)); + }else if(link.slice(0,4) == 'http'){ + Qt.openUrlExternally(link); + } + } + function addTags(str){ + var ret = str.replace(/@[a-zA-Z0-9_]+/g, '$&');//click to jump to user? + var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '$&');//surrounds http links with html link tags + return ret2; + } + + // Strip away paranthesis + function userName(str) { + var user = str.replace(/\([\S|\s]*\)/gi, ""); + return user.trim(); + } + + Item { + id: moveMe; height: parent.height + Rectangle { + id: blackRect + color: "black"; opacity: wrapper.ListView.index % 2 ? 0.2 : 0.3; height: wrapper.height-2; width: wrapper.width; y: 1 + } + Item { + id: image; x: 6; width: 48; height: 48; smooth: true + anchors.verticalCenter: parent.verticalCenter + + Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != Image.Ready } + Image { + id: realImage; + source: userImage; x: 1; y: 1; + width:48; height:48; opacity:0 ; + onStatusChanged: { + if(status==Image.Ready) + image.state="loaded" + } + } + states: State { + name: "loaded"; + PropertyChanges { target: realImage ; opacity:1 } + } + transitions: Transition { NumberAnimation { target: realImage; property: "opacity"; duration: 200 } } + + } + Text { id:txt; y:4; x: 56 + text: '' + + ''+userName(name) + " from " +source + + "
" + statusText + ""; + textFormat: Qt.RichText + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap + anchors.left: image.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6 + onLinkActivated: wrapper.handleLink(link) + } + } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml new file mode 100644 index 00000000..aa090407 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Input.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +FocusScope { + id:container + width: 220 + height: 28 + BorderImage { source: "images/lineedit.sci"; anchors.fill: parent } + signal accepted + property alias text: input.text + property alias item:input + TextInput{ + id: input + width: parent.width - 12 + anchors.centerIn: parent + maximumLength:21 + font.pixelSize: 16; + font.bold: true + color: "#151515"; selectionColor: "mediumseagreen" + focus: true + onAccepted:{container.accepted()} + text: "" + selectByMouse: true + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml new file mode 100644 index 00000000..8520e150 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/Loading.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Image { + id: loading; source: "images/loading.png" + NumberAnimation on rotation { + from: 0; to: 360; running: loading.visible == true; loops: Animation.Infinite; duration: 900 + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml new file mode 100644 index 00000000..2f91399d --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + TitleBar { id: titleBar; width: parent.width; height: 60; + y: -80 + untaggedString: "Latest tweets from everyone" + taggedString: "Latest tweets from " + } + states: [ + State { + name: "search"; when: screen.state!="search" + PropertyChanges { target: titleBar; y: 0 } + } + ] + transitions: [ + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } + ] +} + diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml new file mode 100644 index 00000000..1d2fe52b --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/RssModel.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { id: wrapper + property variant model: xmlModel + property string from : "" + property string to : "" + property string phrase : "" + + property string mode : "everyone" + property int status: xmlModel.status + function reload() { xmlModel.reload(); } + XmlListModel { + id: xmlModel + + source: (from=="" && to=="" && phrase=="") ? "" : + 'http://search.twitter.com/search.atom?from='+from+"&to="+to+"&phrase="+phrase + + namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom'; " + + "declare namespace twitter=\"http://api.twitter.com/\";"; + + query: "/feed/entry" + + XmlRole { name: "statusText"; query: "content/string()" } + XmlRole { name: "timestamp"; query: "published/string()" } + XmlRole { name: "source"; query: "twitter:source/string()" } + XmlRole { name: "name"; query: "author/name/string()" } + XmlRole { name: "userImage"; query: "link[@rel = 'image']/@href/string()" } + + } + Binding { + property: "mode" + target: wrapper + value: {if(wrapper.tags==''){"everyone";}else if(wrapper.tags=='my timeline'){"self";}else{"user";}} + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml new file mode 100644 index 00000000..3991f06b --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/SearchView.qml @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +FocusScope { + id: wrapper + Column { + anchors.centerIn: parent + spacing: 20 + Column{ + spacing: 4 + Text { + text: "Posted by:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: fromIn + KeyNavigation.backtab: searchbutton + KeyNavigation.tab:toIn + onAccepted:searchbutton.doSearch(); + focus: true + } + Text { + text: "In reply to:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: toIn + KeyNavigation.backtab: fromIn + KeyNavigation.tab:phraseIn + onAccepted:searchbutton.doSearch(); + } + Text { + text: "Search phrase:" + font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" + horizontalAlignment: Qt.AlignRight + } + Input{ + id: phraseIn + KeyNavigation.backtab: toIn + KeyNavigation.tab:searchbutton + onAccepted:searchbutton.doSearch(); + text: "Qt Quick" + } + } + Button { + width: 100 + height: 32 + id: searchbutton + keyUsing: true; + opacity: 1 + text: "Search" + KeyNavigation.tab: fromIn + Keys.onReturnPressed: searchbutton.doSearch(); + Keys.onEnterPressed: searchbutton.doSearch(); + Keys.onSelectPressed: searchbutton.doSearch(); + Keys.onSpacePressed: searchbutton.doSearch(); + onClicked: searchbutton.doSearch(); + + function doSearch() { + // Search ! allowed + if (wrapper.state=="invalidinput") + return; + + rssModel.from=fromIn.text; + rssModel.to= toIn.text; + rssModel.phrase = phraseIn.text; + screen.focus = true; + screen.state = "" + } + } + } + states: + State { + name: "invalidinput" + when: fromIn.text=="" && toIn.text=="" && phraseIn.text=="" + PropertyChanges { target: searchbutton ; opacity: 0.6 ; } + } + transitions: + Transition { + NumberAnimation { target: searchbutton; property: "opacity"; duration: 200 } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml new file mode 100644 index 00000000..343e8797 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/TitleBar.qml @@ -0,0 +1,130 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: titleBar + property string untaggedString: "Uploads from everyone" + property string taggedString: "Recent uploads tagged " + + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + + Item { + id: container + width: (parent.width * 2) - 55 ; height: parent.height + + function accept() { + titleBar.state = "" + background.state = "" + rssModel.tags = editor.text + } + + Item { + id:imageBox + x: 6; width: 0; height: 50; smooth: true + anchors.verticalCenter: parent.verticalCenter + + UserModel { user: rssModel.from; id: userModel } + Component { + id: imgDelegate; + Item { + id:imageitem + visible:true + Loading { width:48; height:48; visible: realImage.status != Image.Ready } + Image { id: realImage; source: image; width:48; height:48; opacity:0; } + states: + State { + name: "loaded" + when: (realImage.status == Image.Ready) + PropertyChanges { target: realImage; opacity:1 } + } + transitions: Transition { + NumberAnimation { target: realImage; property: "opacity"; duration: 200 } + } + } + } + ListView { id:view; model: userModel.model; x:1; y:1; delegate: imgDelegate } + states: + State { + when: !userModel.user=="" + PropertyChanges { target: imageBox; width: 50; } + } + transitions: + Transition { + NumberAnimation { target: imageBox; property: "width"; duration: 200 } + } + } + + Image { + id: quitButton + x: 5 + anchors.verticalCenter: parent.verticalCenter + source: "images/quit.png" + MouseArea { + anchors.fill: parent + onClicked: Qt.quit() + } + } + + Text { + id: categoryText + anchors { + left: quitButton.right; right: parent.right; leftMargin: 10; rightMargin: 10 + verticalCenter: parent.verticalCenter + } + elide: Text.ElideLeft + text: (rssModel.from=="" ? untaggedString : taggedString + rssModel.from) + font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black" + font.pixelSize: 12 + } + } + + states: State { + name: "Tags" + PropertyChanges { target: container; x: -tagButton.x + 5 } + PropertyChanges { target: editor; focus: true } + } + + transitions: Transition { + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml new file mode 100644 index 00000000..1b0df39a --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/ToolBar.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Item { + id: toolbar + + property alias button1Label: button1.text + property alias button2Label: button2.text + signal button1Clicked + signal button2Clicked + focus:true + BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } + Button { + id: button1 + anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32 + onClicked: toolbar.button1Clicked() + focus:true + } + Button { + id: button2 + anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32 + onClicked: toolbar.button2Clicked() + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml new file mode 100644 index 00000000..0f5b48d0 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/UserModel.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +//This "model" gets the user information about the searched user. Mainly for the icon. + +Item { id: wrapper + property variant model: xmlModel + property string user : "" + property int status: xmlModel.status + function reload() { xmlModel.reload(); } + XmlListModel { + id: xmlModel + + source: user!= "" ? "http://twitter.com/users/show.xml?screen_name="+user : "" + query: "/user" + + XmlRole { name: "name"; query: "name/string()" } + XmlRole { name: "screenName"; query: "screen_name/string()" } + XmlRole { name: "image"; query: "profile_image_url/string()" } + XmlRole { name: "location"; query: "location/string()" } + XmlRole { name: "description"; query: "description/string()" } + XmlRole { name: "followers"; query: "followers_count/string()" } + //TODO: Could also get the user's color scheme, timezone and a few other things + } +} diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png new file mode 100644 index 00000000..5d370cd9 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/gloss.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png new file mode 100644 index 00000000..2cc38dc3 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci new file mode 100644 index 00000000..054bff78 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/lineedit.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 10 +border.bottom: 10 +border.right: 10 +source: lineedit.png diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png new file mode 100644 index 00000000..47a1589c Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/loading.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png new file mode 100644 index 00000000..5bda1b6e Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/quit.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png new file mode 100644 index 00000000..9f36727e Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/stripes.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png new file mode 100644 index 00000000..51c90082 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci new file mode 100644 index 00000000..0418d94c --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/titlebar.sci @@ -0,0 +1,5 @@ +border.left: 10 +border.top: 12 +border.bottom: 12 +border.right: 10 +source: titlebar.png diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png new file mode 100644 index 00000000..11310013 Binary files /dev/null and b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.png differ diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci new file mode 100644 index 00000000..9e4f9653 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/images/toolbutton.sci @@ -0,0 +1,5 @@ +border.left: 15 +border.top: 4 +border.bottom: 4 +border.right: 15 +source: toolbutton.png diff --git a/examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir new file mode 100644 index 00000000..84d85c28 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/TwitterCore/qmldir @@ -0,0 +1,10 @@ +SearchView 1.0 SearchView.qml +Button 1.0 Button.qml +Input 1.0 Input.qml +FatDelegate 1.0 FatDelegate.qml +Loading 1.0 Loading.qml +MultiTitleBar 1.0 MultiTitleBar.qml +TitleBar 1.0 TitleBar.qml +RssModel 1.0 RssModel.qml +UserModel 1.0 UserModel.qml +ToolBar 1.0 ToolBar.qml diff --git a/examples/declarative/demos/twitter/qml/twitter/twitter.qml b/examples/declarative/demos/twitter/qml/twitter/twitter.qml new file mode 100644 index 00000000..8efc0765 --- /dev/null +++ b/examples/declarative/demos/twitter/qml/twitter/twitter.qml @@ -0,0 +1,134 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the demonstration applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 +import "TwitterCore" 1.0 as Twitter + +Item { + id: screen; width: 320; height: 480 + property bool userView : false + property variant tmpStr + function setUser(str){hack.running = true; tmpStr = str} + function reallySetUser(){rssModel.from = tmpStr;rssModel.to = ""; rssModel.phrase = ""} + state:"searchquery" + //Workaround for bug 260266 + Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack } + Keys.onEscapePressed: screen.state="searchquery" + Keys.onBacktabPressed: screen.state="searchquery" + Rectangle { + id: background + anchors.fill: parent; color: "#343434"; + + state:"searchquery" + Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } + + MouseArea { + anchors.fill: parent + onClicked: screen.focus = false; + } + + Twitter.RssModel { id: rssModel } + Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'} + Text { + width: 180 + text: "Could not access twitter using this screen name and password pair."; + color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap + visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent + } + + Item { + id: views + x: 2; width: parent.width - 4 + y:60 //Below the title bars + height: parent.height - 100 + + Text { + id:title + text: "Search Twitter" + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 20; font.bold: true; color: "#bbb"; style: Text.Raised; styleColor: "black" + opacity:0 + } + + Twitter.SearchView{ + id: searchView + anchors.verticalCenter: parent.verticalCenter + width: parent.width; height: parent.height-60; + x: -(screen.width * 1.5) + } + + Twitter.FatDelegate { id: fatDelegate } + ListView { + id: mainView; model: rssModel.model; delegate: fatDelegate; + width: parent.width; height: parent.height; x: 0; cacheBuffer: 100; + } + } + + Twitter.MultiTitleBar { id: titleBar; width: parent.width } + Twitter.ToolBar { id: toolBar; height: 40; + //anchors.bottom: parent.bottom; + //TODO: Use anchor changes instead of hard coding + y: screen.height - 40 + width: parent.width; opacity: 0.9 + button1Label: "New Search" + button2Label: "Update" + onButton1Clicked: + { + screen.state="searchquery" + } + onButton2Clicked: rssModel.reload(); + } + } + states: [ + State { + name: "searchquery"; + PropertyChanges { target: searchView; x: 0; focus:true} + PropertyChanges { target: mainView; x: -(parent.width * 1.5) } + PropertyChanges { target: titleBar; y: -80 } + PropertyChanges { target: toolBar; y: screen.height } + PropertyChanges { target: toolBar } + PropertyChanges { target: title; opacity:1} + } + ] + transitions: [ + Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutQuad } } + ] +} diff --git a/examples/declarative/demos/twitter/twitter.desktop b/examples/declarative/demos/twitter/twitter.desktop new file mode 100644 index 00000000..5d1b851b --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=twitter +Exec=/opt/twitter/bin/twitter +Icon=twitter64 +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/demos/twitter/twitter.pro b/examples/declarative/demos/twitter/twitter.pro new file mode 100644 index 00000000..26d928ee --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.pro @@ -0,0 +1,24 @@ +# Add more folders to ship with the application, here +folder_01.source = qml/twitter +folder_01.target = qml +DEPLOYMENTFOLDERS = folder_01 + +# Additional import path used to resolve QML modules in Creator's code model +QML_IMPORT_PATH = + +# If your application uses the Qt Mobility libraries, uncomment the following +# lines and add the respective components to the MOBILITY variable. +# CONFIG += mobility +# MOBILITY += + +# Speed up launching on MeeGo/Harmattan when using applauncherd daemon +# CONFIG += qdeclarative-boostable + +# The .cpp file which was generated for your project. Feel free to hack it. +SOURCES += main.cpp + +# Please do not modify the following two lines. Required for deployment. +desktopInstallPrefix = $$[QT_INSTALL_EXAMPLES]/declarative/demos/twitter +exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) +else:include(../../helper/qmlapplicationviewer/qmlapplicationviewer.pri) +qtcAddDeployment() diff --git a/examples/declarative/demos/twitter/twitter.qmlproject b/examples/declarative/demos/twitter/twitter.qmlproject new file mode 100644 index 00000000..3b360cf2 --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.0 + +Project { + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "qml/twitter" + } + JavaScriptFiles { + directory: "qml/twitter" + } + ImageFiles { + directory: "qml/twitter" + } + /* List of plugin directories passed to QML runtime */ + // importPaths: [ " ../exampleplugin " ] +} diff --git a/examples/declarative/demos/twitter/twitter.svg b/examples/declarative/demos/twitter/twitter.svg new file mode 100644 index 00000000..566acfad --- /dev/null +++ b/examples/declarative/demos/twitter/twitter.svg @@ -0,0 +1,93 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/examples/declarative/demos/twitter/twitter64.png b/examples/declarative/demos/twitter/twitter64.png new file mode 100644 index 00000000..707d5c4e Binary files /dev/null and b/examples/declarative/demos/twitter/twitter64.png differ diff --git a/examples/declarative/demos/twitter/twitter80.png b/examples/declarative/demos/twitter/twitter80.png new file mode 100644 index 00000000..6ad8096c Binary files /dev/null and b/examples/declarative/demos/twitter/twitter80.png differ diff --git a/examples/declarative/demos/twitter/twitter_harmattan.desktop b/examples/declarative/demos/twitter/twitter_harmattan.desktop new file mode 100644 index 00000000..40a4a1bc --- /dev/null +++ b/examples/declarative/demos/twitter/twitter_harmattan.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Name=twitter +Exec=/usr/bin/single-instance /opt/twitter/bin/twitter +Icon=/usr/share/icons/hicolor/80x80/apps/twitter80.png +X-Window-Icon= +X-HildonDesk-ShowInToolbar=true +X-Osso-Type=application/x-executable diff --git a/examples/declarative/minehunt/README b/examples/declarative/minehunt/README deleted file mode 100644 index 3849ca5f..00000000 --- a/examples/declarative/minehunt/README +++ /dev/null @@ -1,6 +0,0 @@ -Minehunt has to be compiled to run. - -To compile the C++ part, do 'qmake && make'. -To run, simply run the executable. -To deploy on a device, do 'make sis'. - diff --git a/examples/declarative/minehunt/main.cpp b/examples/declarative/minehunt/main.cpp deleted file mode 100644 index d23c2b3a..00000000 --- a/examples/declarative/minehunt/main.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include "minehunt.h" -#include -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QmlApplicationViewer viewer; - - qmlRegisterType(); - MinehuntGame* game = new MinehuntGame(); - - viewer.engine()->rootContext()->setContextObject(game); - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); - viewer.setMainQmlFile(QLatin1String("qml/minehunt/minehunt.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/minehunt/minehunt.cpp b/examples/declarative/minehunt/minehunt.cpp deleted file mode 100644 index 70ca035e..00000000 --- a/examples/declarative/minehunt/minehunt.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#include "minehunt.h" - -void tilesPropAppend(QDeclarativeListProperty* prop, TileData* value) -{ - Q_UNUSED(prop); - Q_UNUSED(value); - return; //Append not supported -} - -int tilesPropCount(QDeclarativeListProperty* prop) -{ - return static_cast*>(prop->data)->count(); -} - -TileData* tilesPropAt(QDeclarativeListProperty* prop, int index) -{ - return static_cast*>(prop->data)->at(index); -} - -QDeclarativeListProperty MinehuntGame::tiles(){ - return QDeclarativeListProperty(this, &_tiles, &tilesPropAppend, - &tilesPropCount, &tilesPropAt, 0); -} - -MinehuntGame::MinehuntGame() -: numCols(9), numRows(9), playing(true), won(false) -{ - setObjectName("mainObject"); - srand(QTime(0,0,0).secsTo(QTime::currentTime())); - - //initialize array - for(int ii = 0; ii < numRows * numCols; ++ii) { - _tiles << new TileData; - } - reset(); - -} - -void MinehuntGame::setBoard() -{ - foreach(TileData* t, _tiles){ - t->setHasMine(false); - t->setHint(-1); - } - //place mines - int mines = nMines; - remaining = numRows*numCols-mines; - while ( mines ) { - int col = int((double(rand()) / double(RAND_MAX)) * numCols); - int row = int((double(rand()) / double(RAND_MAX)) * numRows); - - TileData* t = tile( row, col ); - - if (t && !t->hasMine()) { - t->setHasMine( true ); - mines--; - } - } - - //set hints - for (int r = 0; r < numRows; r++) - for (int c = 0; c < numCols; c++) { - TileData* t = tile(r, c); - if (t && !t->hasMine()) { - int hint = getHint(r,c); - t->setHint(hint); - } - } - - setPlaying(true); -} - -void MinehuntGame::reset() -{ - foreach(TileData* t, _tiles){ - t->unflip(); - t->setHasFlag(false); - } - nMines = 12; - nFlags = 0; - emit numMinesChanged(); - emit numFlagsChanged(); - setPlaying(false); - QTimer::singleShot(600,this, SLOT(setBoard())); -} - -int MinehuntGame::getHint(int row, int col) -{ - int hint = 0; - for (int c = col-1; c <= col+1; c++) - for (int r = row-1; r <= row+1; r++) { - TileData* t = tile(r, c); - if (t && t->hasMine()) - hint++; - } - return hint; -} - -bool MinehuntGame::flip(int row, int col) -{ - if(!playing) - return false; - - TileData *t = tile(row, col); - if (!t || t->hasFlag()) - return false; - - if(t->flipped()){ - int flags = 0; - for (int c = col-1; c <= col+1; c++) - for (int r = row-1; r <= row+1; r++) { - TileData *nearT = tile(r, c); - if(!nearT || nearT == t) - continue; - if(nearT->hasFlag()) - flags++; - } - if(!t->hint() || t->hint() != flags) - return false; - for (int c = col-1; c <= col+1; c++) - for (int r = row-1; r <= row+1; r++) { - TileData *nearT = tile(r, c); - if (nearT && !nearT->flipped() && !nearT->hasFlag()) { - flip( r, c ); - } - } - return true; - } - - t->flip(); - - if (t->hint() == 0) { - for (int c = col-1; c <= col+1; c++) - for (int r = row-1; r <= row+1; r++) { - TileData* t = tile(r, c); - if (t && !t->flipped()) { - flip( r, c ); - } - } - } - - if(t->hasMine()){ - for (int r = 0; r < numRows; r++)//Flip all other mines - for (int c = 0; c < numCols; c++) { - TileData* t = tile(r, c); - if (t && t->hasMine()) { - flip(r, c); - } - } - won = false; - hasWonChanged(); - setPlaying(false); - return true; - } - - remaining--; - if(!remaining){ - won = true; - hasWonChanged(); - setPlaying(false); - return true; - } - return true; -} - -bool MinehuntGame::flag(int row, int col) -{ - TileData *t = tile(row, col); - if(!t || !playing || t->flipped()) - return false; - - t->setHasFlag(!t->hasFlag()); - nFlags += (t->hasFlag()?1:-1); - emit numFlagsChanged(); - return true; -} diff --git a/examples/declarative/minehunt/minehunt.h b/examples/declarative/minehunt/minehunt.h deleted file mode 100644 index cbde1a56..00000000 --- a/examples/declarative/minehunt/minehunt.h +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include - -class TileData : public QObject -{ - Q_OBJECT -public: - TileData() : _hasFlag(false), _hasMine(false), _hint(-1), _flipped(false) {} - - Q_PROPERTY(bool hasFlag READ hasFlag WRITE setHasFlag NOTIFY hasFlagChanged) - bool hasFlag() const { return _hasFlag; } - - Q_PROPERTY(bool hasMine READ hasMine NOTIFY hasMineChanged) - bool hasMine() const { return _hasMine; } - - Q_PROPERTY(int hint READ hint NOTIFY hintChanged) - int hint() const { return _hint; } - - Q_PROPERTY(bool flipped READ flipped NOTIFY flippedChanged()) - bool flipped() const { return _flipped; } - - void setHasFlag(bool flag) {if(flag==_hasFlag) return; _hasFlag = flag; emit hasFlagChanged();} - void setHasMine(bool mine) {if(mine==_hasMine) return; _hasMine = mine; emit hasMineChanged();} - void setHint(int hint) { if(hint == _hint) return; _hint = hint; emit hintChanged(); } - void flip() { if (_flipped) return; _flipped = true; emit flippedChanged(); } - void unflip() { if(!_flipped) return; _flipped = false; emit flippedChanged(); } - -signals: - void flippedChanged(); - void hasFlagChanged(); - void hintChanged(); - void hasMineChanged(); - -private: - bool _hasFlag; - bool _hasMine; - int _hint; - bool _flipped; -}; - -class MinehuntGame : public QObject -{ - Q_OBJECT -public: - MinehuntGame(); - - Q_PROPERTY(QDeclarativeListProperty tiles READ tiles CONSTANT) - QDeclarativeListProperty tiles(); - - Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY isPlayingChanged) - bool isPlaying() {return playing;} - - Q_PROPERTY(bool hasWon READ hasWon NOTIFY hasWonChanged) - bool hasWon() {return won;} - - Q_PROPERTY(int numMines READ numMines NOTIFY numMinesChanged) - int numMines() const{return nMines;} - - Q_PROPERTY(int numFlags READ numFlags NOTIFY numFlagsChanged) - int numFlags() const{return nFlags;} - -public slots: - Q_INVOKABLE bool flip(int row, int col); - Q_INVOKABLE bool flag(int row, int col); - void setBoard(); - void reset(); - -signals: - void isPlayingChanged(); - void hasWonChanged(); - void numMinesChanged(); - void numFlagsChanged(); - -private: - bool onBoard( int r, int c ) const { return r >= 0 && r < numRows && c >= 0 && c < numCols; } - TileData *tile( int row, int col ) { return onBoard(row, col) ? _tiles[col+numRows*row] : 0; } - int getHint(int row, int col); - void setPlaying(bool b){if(b==playing) return; playing=b; emit isPlayingChanged();} - - QList _tiles; - int numCols; - int numRows; - bool playing; - bool won; - int remaining; - int nMines; - int nFlags; -}; diff --git a/examples/declarative/minehunt/minehunt.pro b/examples/declarative/minehunt/minehunt.pro deleted file mode 100644 index 6a630a1f..00000000 --- a/examples/declarative/minehunt/minehunt.pro +++ /dev/null @@ -1,25 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/minehunt -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -HEADERS += minehunt.h -SOURCES += main.cpp minehunt.cpp -RESOURCES = minehunt.qrc - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/minehunt -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/minehunt/minehunt.qmlproject b/examples/declarative/minehunt/minehunt.qmlproject deleted file mode 100644 index 1f8b659f..00000000 --- a/examples/declarative/minehunt/minehunt.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/minehunt" - } - JavaScriptFiles { - directory: "qml/minehunt" - } - ImageFiles { - directory: "qml/minehunt" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/minehunt/minehunt.qrc b/examples/declarative/minehunt/minehunt.qrc deleted file mode 100644 index 4694beb1..00000000 --- a/examples/declarative/minehunt/minehunt.qrc +++ /dev/null @@ -1,19 +0,0 @@ - - - qml/minehunt/minehunt.qml - qml/minehunt/MinehuntCore/Explosion.qml - qml/minehunt/MinehuntCore/Tile.qml - qml/minehunt/MinehuntCore/pics/background.png - qml/minehunt/MinehuntCore/pics/back.png - qml/minehunt/MinehuntCore/pics/bomb-color.png - qml/minehunt/MinehuntCore/pics/bomb.png - qml/minehunt/MinehuntCore/pics/face-sad.png - qml/minehunt/MinehuntCore/pics/face-smile-big.png - qml/minehunt/MinehuntCore/pics/face-smile.png - qml/minehunt/MinehuntCore/pics/flag-color.png - qml/minehunt/MinehuntCore/pics/flag.png - qml/minehunt/MinehuntCore/pics/front.png - qml/minehunt/MinehuntCore/pics/quit.png - qml/minehunt/MinehuntCore/pics/star.png - - diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml deleted file mode 100644 index 8970b0ec..00000000 --- a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/Explosion.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt.labs.particles 1.0 - -Item { - property bool explode : false - - Particles { - id: particles - width: 40 - height: 40 - lifeSpan: 1000 - lifeSpanDeviation: 0 - source: "pics/star.png" - count: 0 - angle: 270 - angleDeviation: 360 - velocity: 100 - velocityDeviation: 20 - z: 100 - } - states: State { name: "exploding"; when: explode - StateChangeScript {script: particles.burst(200); } - } -} diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml deleted file mode 100644 index 79529ef3..00000000 --- a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/Tile.qml +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Flipable { - id: flipable - property int angle: 0 - - width: 40; height: 40 - transform: Rotation { origin.x: 20; origin.y: 20; axis.x: 1; axis.z: 0; angle: flipable.angle } - - front: Image { - source: "pics/front.png"; width: 40; height: 40 - - Image { - anchors.centerIn: parent - source: "pics/flag.png"; opacity: modelData.hasFlag - - Behavior on opacity { NumberAnimation {} } - } - } - - back: Image { - source: "pics/back.png" - width: 40; height: 40 - - Text { - anchors.centerIn: parent - text: modelData.hint; color: "white"; font.bold: true - opacity: !modelData.hasMine && modelData.hint > 0 - } - - Image { - anchors.centerIn: parent - source: "pics/bomb.png"; opacity: modelData.hasMine - } - - Explosion { id: expl } - } - - states: State { - name: "back"; when: modelData.flipped - PropertyChanges { target: flipable; angle: 180 } - } - - property real pauseDur: 250 - transitions: Transition { - SequentialAnimation { - ScriptAction { - script: { - var ret = Math.abs(flipable.x - field.clickx) - + Math.abs(flipable.y - field.clicky); - if (modelData.hasMine && modelData.flipped) - pauseDur = ret * 3 - else - pauseDur = ret - } - } - PauseAnimation { - duration: pauseDur - } - RotationAnimation { easing.type: Easing.InOutQuad } - ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } } - } - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: { - field.clickx = flipable.x - field.clicky = flipable.y - var row = Math.floor(index / 9) - var col = index - (Math.floor(index / 9) * 9) - if (mouse.button == undefined || mouse.button == Qt.RightButton) { - flag(row, col) - } else { - flip(row, col) - } - } - onPressAndHold: { - field.clickx = flipable.x - field.clicky = flipable.y - var row = Math.floor(index / 9) - var col = index - (Math.floor(index / 9) * 9) - flag(row, col) - } - } -} diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png deleted file mode 100644 index f6b3f0b4..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/back.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png deleted file mode 100644 index 3734a277..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/background.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png deleted file mode 100644 index 61ad0a92..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb-color.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png deleted file mode 100644 index a9925755..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/bomb.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png deleted file mode 100644 index cf00aafe..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-sad.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png deleted file mode 100644 index f9c2335d..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile-big.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png deleted file mode 100644 index 3d66d725..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/face-smile.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png deleted file mode 100644 index aadad0f1..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag-color.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png deleted file mode 100644 index 39cde4df..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/flag.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png deleted file mode 100644 index 834331bd..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/front.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png deleted file mode 100644 index b822057d..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/quit.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png b/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png deleted file mode 100644 index 37723591..00000000 Binary files a/examples/declarative/minehunt/qml/minehunt/MinehuntCore/pics/star.png and /dev/null differ diff --git a/examples/declarative/minehunt/qml/minehunt/minehunt.qml b/examples/declarative/minehunt/qml/minehunt/minehunt.qml deleted file mode 100644 index 92dba346..00000000 --- a/examples/declarative/minehunt/qml/minehunt/minehunt.qml +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "MinehuntCore" - -Item { - id: field - property int clickx: 0 - property int clicky: 0 - - width: 450; height: 450 - - Image { source: "MinehuntCore/pics/background.png"; anchors.fill: parent; fillMode: Image.Tile } - - Grid { - anchors.horizontalCenter: parent.horizontalCenter - columns: 9; spacing: 1 - - Repeater { - id: repeater - model: tiles - delegate: Tile {} - } - } - - Row { - id: gamedata - x: 20; spacing: 20 - anchors.bottom: field.bottom; anchors.bottomMargin: 15 - - Image { - source: "MinehuntCore/pics/quit.png" - scale: quitMouse.pressed ? 0.8 : 1.0 - smooth: quitMouse.pressed - y: 10 - MouseArea { - id: quitMouse - anchors.fill: parent - anchors.margins: -20 - onClicked: Qt.quit() - } - } - Column { - spacing: 2 - Image { source: "MinehuntCore/pics/bomb-color.png" } - Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numMines } - } - - Column { - spacing: 2 - Image { source: "MinehuntCore/pics/flag-color.png" } - Text { anchors.horizontalCenter: parent.horizontalCenter; color: "white"; text: numFlags } - } - } - - Image { - anchors.bottom: field.bottom; anchors.bottomMargin: 15 - anchors.right: field.right; anchors.rightMargin: 20 - source: isPlaying ? 'MinehuntCore/pics/face-smile.png' : - hasWon ? 'MinehuntCore/pics/face-smile-big.png': 'MinehuntCore/pics/face-sad.png' - - MouseArea { anchors.fill: parent; onPressed: reset() } - } - Text { - anchors.centerIn: parent; width: parent.width - 20 - horizontalAlignment: Text.AlignHCenter - wrapMode: Text.WordWrap - text: "Minehunt demo has to be compiled to run.\n\nPlease see README." - color: "white"; font.bold: true; font.pixelSize: 14 - visible: tiles == undefined - } - -} diff --git a/examples/declarative/photoviewer/main.cpp b/examples/declarative/photoviewer/main.cpp deleted file mode 100644 index 61ac2717..00000000 --- a/examples/declarative/photoviewer/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QmlApplicationViewer viewer; - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/photoviewer/photoviewer.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/photoviewer/photoviewer.desktop b/examples/declarative/photoviewer/photoviewer.desktop deleted file mode 100644 index 4246b9f3..00000000 --- a/examples/declarative/photoviewer/photoviewer.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=photoviewer -Exec=/opt/photoviewer/bin/photoviewer -Icon=photoviewer64 -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/photoviewer/photoviewer.pro b/examples/declarative/photoviewer/photoviewer.pro deleted file mode 100644 index 5e7849f9..00000000 --- a/examples/declarative/photoviewer/photoviewer.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/photoviewer -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/photoviewer -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/photoviewer/photoviewer.qmlproject b/examples/declarative/photoviewer/photoviewer.qmlproject deleted file mode 100644 index 025a3a8f..00000000 --- a/examples/declarative/photoviewer/photoviewer.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/photoviewer" - } - JavaScriptFiles { - directory: "qml/photoviewer" - } - ImageFiles { - directory: "qml/photoviewer" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/photoviewer/photoviewer.svg b/examples/declarative/photoviewer/photoviewer.svg deleted file mode 100644 index 566acfad..00000000 --- a/examples/declarative/photoviewer/photoviewer.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/photoviewer/photoviewer64.png b/examples/declarative/photoviewer/photoviewer64.png deleted file mode 100644 index 707d5c4e..00000000 Binary files a/examples/declarative/photoviewer/photoviewer64.png and /dev/null differ diff --git a/examples/declarative/photoviewer/photoviewer80.png b/examples/declarative/photoviewer/photoviewer80.png deleted file mode 100644 index 6ad8096c..00000000 Binary files a/examples/declarative/photoviewer/photoviewer80.png and /dev/null differ diff --git a/examples/declarative/photoviewer/photoviewer_harmattan.desktop b/examples/declarative/photoviewer/photoviewer_harmattan.desktop deleted file mode 100644 index 2dced148..00000000 --- a/examples/declarative/photoviewer/photoviewer_harmattan.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=photoviewer -Exec=/usr/bin/single-instance /opt/photoviewer/bin/photoviewer -Icon=/usr/share/icons/hicolor/80x80/apps/photoviewer80.png -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml deleted file mode 100644 index 696f1539..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Component { - id: albumDelegate - Package { - - Item { - Package.name: 'browser' - GridView { - id: photosGridView; model: visualModel.parts.grid; width: mainWindow.width; height: mainWindow.height - 21 - x: 0; y: 21; cellWidth: 160; cellHeight: 153; interactive: false - onCurrentIndexChanged: photosListView.positionViewAtIndex(currentIndex, ListView.Contain) - } - } - - Item { - Package.name: 'fullscreen' - ListView { - id: photosListView; model: visualModel.parts.list; orientation: Qt.Horizontal - width: mainWindow.width; height: mainWindow.height; interactive: false - onCurrentIndexChanged: photosGridView.positionViewAtIndex(currentIndex, GridView.Contain) - highlightRangeMode: ListView.StrictlyEnforceRange; snapMode: ListView.SnapOneItem - } - } - - Item { - Package.name: 'album' - id: albumWrapper; width: 210; height: 220 - - VisualDataModel { - id: visualModel; delegate: PhotoDelegate { } - model: RssModel { id: rssModel; tags: tag } - } - - BusyIndicator { - id: busyIndicator - anchors { centerIn: parent; verticalCenterOffset: -20 } - on: rssModel.status != XmlListModel.Ready - } - - PathView { - id: photosPathView; model: visualModel.parts.stack; pathItemCount: 5 - visible: !busyIndicator.visible - anchors.centerIn: parent; anchors.verticalCenterOffset: -30 - path: Path { - PathAttribute { name: 'z'; value: 9999.0 } - PathLine { x: 1; y: 1 } - PathAttribute { name: 'z'; value: 0.0 } - } - } - - MouseArea { - anchors.fill: parent - onClicked: mainWindow.editMode ? photosModel.remove(index) : albumWrapper.state = 'inGrid' - } - - Tag { - anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 } - frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode - onTagChanged: rssModel.tags = tag - onBackClicked: if (mainWindow.editMode) photosModel.remove(index); - } - - states: [ - State { - name: 'inGrid' - PropertyChanges { target: photosGridView; interactive: true } - PropertyChanges { target: albumsShade; opacity: 1 } - PropertyChanges { target: backButton; onClicked: albumWrapper.state = ''; y: 6 } - }, - State { - name: 'fullscreen'; extend: 'inGrid' - PropertyChanges { target: photosGridView; interactive: false } - PropertyChanges { target: photosListView; interactive: true } - PropertyChanges { target: photosShade; opacity: 1 } - PropertyChanges { target: backButton; y: -backButton.height - 8 } - } - ] - - GridView.onAdd: NumberAnimation { - target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad - } - GridView.onRemove: SequentialAnimation { - PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad } - PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } - } - - transitions: [ - Transition { - from: '*'; to: 'inGrid' - SequentialAnimation { - NumberAnimation { properties: 'opacity'; duration: 250 } - PauseAnimation { duration: 350 } - NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad } - } - }, - Transition { - from: 'inGrid'; to: '*' - NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 } - } - ] - } - } -} diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml deleted file mode 100644 index 7d5cd577..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/BusyIndicator.qml +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.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/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml deleted file mode 100644 index 76d39afc..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Button.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: container - - property alias label: labelText.text - property color tint: "transparent" - signal clicked - - width: labelText.width + 70 ; height: labelText.height + 18 - - BorderImage { - anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } - source: 'images/box-shadow.png'; smooth: true - border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 - } - - Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true } - - Rectangle { - anchors.fill: container; color: container.tint; visible: container.tint != "" - opacity: 0.25; smooth: true - } - - Text { id: labelText; font.pixelSize: 15; anchors.centerIn: parent; smooth: true } - - MouseArea { - anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } - onClicked: container.clicked() - } -} diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml deleted file mode 100644 index 1edcd575..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/EditableButton.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: container - - property string label - signal clicked - signal labelChanged(string label) - - width: textInput.width + 70 ; height: textInput.height + 18 - - BorderImage { - anchors { fill: container; leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 } - source: 'images/box-shadow.png'; smooth: true - border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 - } - - Image { anchors.fill: parent; source: "images/cardboard.png"; smooth: true } - - TextInput { - id: textInput; text: label; font.pixelSize: 15; anchors.centerIn: parent; smooth: true - Keys.onReturnPressed: { - container.labelChanged(textInput.text) - container.focus = true - } - Keys.onEnterPressed: { - container.labelChanged(textInput.text) - container.focus = true - } - Keys.onEscapePressed: { - textInput.text = container.label - container.focus = true - } - } - - Rectangle { - anchors.fill: container; border.color: "steelblue"; border.width: 4 - color: "transparent"; visible: textInput.focus; smooth: true - } - - MouseArea { - anchors { fill: parent; leftMargin: -20; topMargin: -20; rightMargin: -20; bottomMargin: -20 } - onClicked: { textInput.forceActiveFocus(); textInput.openSoftwareInputPanel(); } - } -} diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml deleted file mode 100644 index cace0588..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/PhotoDelegate.qml +++ /dev/null @@ -1,188 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 -import "script/script.js" as Script - -Package { - Item { id: stackItem; Package.name: 'stack'; width: 160; height: 153; z: stackItem.PathView.z } - Item { id: listItem; Package.name: 'list'; width: mainWindow.width + 40; height: 153 } - Item { id: gridItem; Package.name: 'grid'; width: 160; height: 153 } - - Item { - width: 160; height: 153 - - Item { - id: photoWrapper - - property double randomAngle: Math.random() * (2 * 6 + 1) - 6 - property double randomAngle2: Math.random() * (2 * 6 + 1) - 6 - - x: 0; y: 0; width: 140; height: 133 - z: stackItem.PathView.z; rotation: photoWrapper.randomAngle - - BorderImage { - anchors { - fill: originalImage.status == Image.Ready ? border : placeHolder - leftMargin: -6; topMargin: -6; rightMargin: -8; bottomMargin: -8 - } - source: 'images/box-shadow.png'; smooth: true - border.left: 10; border.top: 10; border.right: 10; border.bottom: 10 - } - Rectangle { - id: placeHolder - - property int w: Script.getWidth(content) - property int h: Script.getHeight(content) - property double s: Script.calculateScale(w, h, photoWrapper.width) - - color: 'white'; anchors.centerIn: parent; smooth: true - width: w * s; height: h * s; visible: originalImage.status != Image.Ready - Rectangle { - color: "#878787"; smooth: true - anchors { fill: parent; topMargin: 3; bottomMargin: 3; leftMargin: 3; rightMargin: 3 } - } - } - Rectangle { - id: border; color: 'white'; anchors.centerIn: parent; smooth: true - width: originalImage.paintedWidth + 6; height: originalImage.paintedHeight + 6 - visible: !placeHolder.visible - } - BusyIndicator { anchors.centerIn: parent; on: originalImage.status != Image.Ready } - Image { - id: originalImage; smooth: true; source: "http://" + Script.getImagePath(content); cache: false - fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height - } - Image { - id: hqImage; smooth: true; source: ""; visible: false; cache: false - fillMode: Image.PreserveAspectFit; width: photoWrapper.width; height: photoWrapper.height - } - Binding { - target: mainWindow; property: "downloadProgress"; value: hqImage.progress - when: listItem.ListView.isCurrentItem - } - Binding { - target: mainWindow; property: "imageLoading" - value: (hqImage.status == Image.Loading) ? 1 : 0; when: listItem.ListView.isCurrentItem - } - MouseArea { - width: originalImage.paintedWidth; height: originalImage.paintedHeight; anchors.centerIn: originalImage - onClicked: { - if (albumWrapper.state == 'inGrid') { - gridItem.GridView.view.currentIndex = index; - albumWrapper.state = 'fullscreen' - } else { - gridItem.GridView.view.currentIndex = index; - albumWrapper.state = 'inGrid' - } - } - } - - states: [ - State { - name: 'stacked'; when: albumWrapper.state == '' - ParentChange { target: photoWrapper; parent: stackItem; x: 10; y: 10 } - PropertyChanges { target: photoWrapper; opacity: stackItem.PathView.onPath ? 1.0 : 0.0 } - }, - State { - name: 'inGrid'; when: albumWrapper.state == 'inGrid' - ParentChange { target: photoWrapper; parent: gridItem; x: 10; y: 10; rotation: photoWrapper.randomAngle2 } - }, - State { - name: 'fullscreen'; when: albumWrapper.state == 'fullscreen' - ParentChange { - target: photoWrapper; parent: listItem; x: 0; y: 0; rotation: 0 - width: mainWindow.width; height: mainWindow.height - } - PropertyChanges { target: border; opacity: 0 } - PropertyChanges { target: hqImage; source: listItem.ListView.isCurrentItem ? hq : ""; visible: true } - } - ] - - transitions: [ - Transition { - from: 'stacked'; to: 'inGrid' - SequentialAnimation { - PauseAnimation { duration: 10 * index } - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { - target: photoWrapper; properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' - } - } - } - }, - Transition { - from: 'inGrid'; to: 'stacked' - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { properties: 'x,y,rotation,opacity'; duration: 600; easing.type: 'OutQuart' } - } - }, - Transition { - from: 'inGrid'; to: 'fullscreen' - SequentialAnimation { - PauseAnimation { duration: gridItem.GridView.isCurrentItem ? 0 : 600 } - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { - targets: [ photoWrapper, border ] - properties: 'x,y,width,height,opacity,rotation' - duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' - } - } - } - }, - Transition { - from: 'fullscreen'; to: 'inGrid' - ParentAnimation { - target: photoWrapper; via: foreground - NumberAnimation { - targets: [ photoWrapper, border ] - properties: 'x,y,width,height,rotation,opacity' - duration: gridItem.GridView.isCurrentItem ? 600 : 1; easing.type: 'OutQuart' - } - } - } - ] - } - } -} diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml deleted file mode 100644 index 6fe73021..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/ProgressBar.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.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/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml deleted file mode 100644 index 02c73a36..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/RssModel.qml +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -XmlListModel { - property string tags : "" - - source: "http://api.flickr.com/services/feeds/photos_public.gne?"+(tags ? "tags="+tags+"&" : "") - query: "/feed/entry" - namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom';" - - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "content"; query: "content/string()" } - XmlRole { name: "hq"; query: "link[@rel='enclosure']/@href/string()" } -} diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml deleted file mode 100644 index af9e0fde..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/Tag.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.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/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png deleted file mode 100644 index 431af854..00000000 Binary files a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/box-shadow.png and /dev/null differ diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png deleted file mode 100644 index 664c2b14..00000000 Binary files a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/busy.png and /dev/null differ diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png deleted file mode 100644 index 1847ab52..00000000 Binary files a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/images/cardboard.png and /dev/null differ diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir deleted file mode 100644 index d3c247f2..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/qmldir +++ /dev/null @@ -1,8 +0,0 @@ -AlbumDelegate AlbumDelegate.qml -PhotoDelegate PhotoDelegate.qml -ProgressBar ProgressBar.qml -RssModel RssModel.qml -BusyIndicator BusyIndicator.qml -EditableButton EditableButton.qml -Button Button.qml -Tag Tag.qml diff --git a/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js b/examples/declarative/photoviewer/qml/photoviewer/PhotoViewerCore/script/script.js deleted file mode 100644 index e8ef93a8..00000000 --- a/examples/declarative/photoviewer/qml/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/declarative/photoviewer/qml/photoviewer/i18n/base.ts b/examples/declarative/photoviewer/qml/photoviewer/i18n/base.ts deleted file mode 100644 index 1accfd2f..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/i18n/base.ts +++ /dev/null @@ -1,30 +0,0 @@ - - - - - AlbumDelegate - - - Remove - - - - - photoviewer - - - Add - - - - - Edit - - - - - Back - - - - diff --git a/examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm b/examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm deleted file mode 100644 index c24fcbc4..00000000 Binary files a/examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.qm and /dev/null differ diff --git a/examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts b/examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts deleted file mode 100644 index 9f892db6..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/i18n/qml_fr.ts +++ /dev/null @@ -1,30 +0,0 @@ - - - - - AlbumDelegate - - - Remove - Supprimer - - - - photoviewer - - - Add - Ajouter - - - - Edit - Éditer - - - - Back - Retour - - - diff --git a/examples/declarative/photoviewer/qml/photoviewer/photoviewer.qml b/examples/declarative/photoviewer/qml/photoviewer/photoviewer.qml deleted file mode 100644 index 6c7285f7..00000000 --- a/examples/declarative/photoviewer/qml/photoviewer/photoviewer.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "PhotoViewerCore" - -Rectangle { - id: mainWindow - - property real downloadProgress: 0 - property bool imageLoading: false - property bool editMode: false - - width: 800; height: 480; color: "#d5d6d8" - - ListModel { - id: photosModel - ListElement { tag: "Flowers" } - ListElement { tag: "Wildlife" } - ListElement { tag: "Prague" } - } - - VisualDataModel { id: albumVisualModel; model: photosModel; delegate: AlbumDelegate {} } - - GridView { - id: albumView; width: parent.width; height: parent.height; cellWidth: 210; cellHeight: 220 - model: albumVisualModel.parts.album; visible: albumsShade.opacity != 1.0 - } - - Column { - spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 } - Button { - id: newButton; label: qsTr("Add"); rotation: 3 - anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - mainWindow.editMode = false - photosModel.append( { tag: "" } ) - albumView.positionViewAtIndex(albumView.count - 1, GridView.Contain) - } - } - Button { - id: deleteButton; label: qsTr("Edit"); rotation: -2; - onClicked: mainWindow.editMode = !mainWindow.editMode - anchors.horizontalCenter: parent.horizontalCenter - } - Button { - id: quitButton; label: qsTr("Quit"); rotation: -2; - onClicked: Qt.quit() - anchors.horizontalCenter: parent.horizontalCenter - } - } - - Rectangle { - id: albumsShade; color: mainWindow.color - width: parent.width; height: parent.height; opacity: 0.0 - } - - ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false } - - Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } - - Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 } - - ListView { anchors.fill: parent; model: albumVisualModel.parts.fullscreen; interactive: false } - - Item { id: foreground; anchors.fill: parent } - - ProgressBar { - progress: mainWindow.downloadProgress; width: parent.width; height: 4 - anchors.bottom: parent.bottom; opacity: mainWindow.imageLoading; visible: opacity != 0.0 - } -} diff --git a/examples/declarative/rssnews/main.cpp b/examples/declarative/rssnews/main.cpp deleted file mode 100644 index d4066f73..00000000 --- a/examples/declarative/rssnews/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QmlApplicationViewer viewer; - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/rssnews/rssnews.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml b/examples/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml deleted file mode 100644 index 71e6c019..00000000 --- a/examples/declarative/rssnews/qml/rssnews/content/BusyIndicator.qml +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.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/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml b/examples/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml deleted file mode 100644 index a1ad72c4..00000000 --- a/examples/declarative/rssnews/qml/rssnews/content/CategoryDelegate.qml +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: delegate - - width: delegate.ListView.view.width; height: 60 - - Text { - text: name - color: delegate.ListView.isCurrentItem ? "white" : "black" - font { family: "Helvetica"; pixelSize: 16; bold: true } - anchors { - left: parent.left; leftMargin: 15 - verticalCenter: parent.verticalCenter - } - } - - BusyIndicator { - scale: 0.6 - on: delegate.ListView.isCurrentItem && window.loading - anchors { right: parent.right; rightMargin: 10; verticalCenter: parent.verticalCenter } - } - - Rectangle { - width: delegate.width; height: 1; color: "#cccccc" - anchors.bottom: delegate.bottom - visible: delegate.ListView.isCurrentItem ? false : true - } - Rectangle { - width: delegate.width; height: 1; color: "white" - visible: delegate.ListView.isCurrentItem ? false : true - } - - MouseArea { - anchors.fill: delegate - onClicked: { - delegate.ListView.view.currentIndex = index - window.currentFeed = feed - } - } -} diff --git a/examples/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml b/examples/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml deleted file mode 100644 index 3a3be14c..00000000 --- a/examples/declarative/rssnews/qml/rssnews/content/NewsDelegate.qml +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: delegate - height: column.height + 40 - width: delegate.ListView.view.width - - Column { - id: column - x: 20; y: 20 - width: parent.width - 40 - - Text { - id: titleText - text: title; width: parent.width; wrapMode: Text.WordWrap - font { bold: true; family: "Helvetica"; pointSize: 16 } - } - - Text { - id: descriptionText - width: parent.width; text: description - wrapMode: Text.WordWrap; font.family: "Helvetica" - } - } - - Rectangle { - width: parent.width; height: 1; color: "#cccccc" - anchors.bottom: parent.bottom - } -} diff --git a/examples/declarative/rssnews/qml/rssnews/content/RssFeeds.qml b/examples/declarative/rssnews/qml/rssnews/content/RssFeeds.qml deleted file mode 100644 index c2285b25..00000000 --- a/examples/declarative/rssnews/qml/rssnews/content/RssFeeds.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -ListModel { - id: rssFeeds - - ListElement { name: "Top Stories"; feed: "rss.news.yahoo.com/rss/topstories" } - ListElement { name: "World"; feed: "rss.news.yahoo.com/rss/world" } - ListElement { name: "Europe"; feed: "rss.news.yahoo.com/rss/europe" } - ListElement { name: "Oceania"; feed: "rss.news.yahoo.com/rss/oceania" } - ListElement { name: "U.S. National"; feed: "rss.news.yahoo.com/rss/us" } - ListElement { name: "Politics"; feed: "rss.news.yahoo.com/rss/politics" } - ListElement { name: "Business"; feed: "rss.news.yahoo.com/rss/business" } - ListElement { name: "Technology"; feed: "rss.news.yahoo.com/rss/tech" } - ListElement { name: "Entertainment"; feed: "rss.news.yahoo.com/rss/entertainment" } - ListElement { name: "Health"; feed: "rss.news.yahoo.com/rss/health" } - ListElement { name: "Science"; feed: "rss.news.yahoo.com/rss/science" } - ListElement { name: "Sports"; feed: "rss.news.yahoo.com/rss/sports" } -} diff --git a/examples/declarative/rssnews/qml/rssnews/content/ScrollBar.qml b/examples/declarative/rssnews/qml/rssnews/content/ScrollBar.qml deleted file mode 100644 index a873bd3e..00000000 --- a/examples/declarative/rssnews/qml/rssnews/content/ScrollBar.qml +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: container - - property variant scrollArea - property variant orientation: Qt.Vertical - - opacity: 0 - - function position() - { - var ny = 0; - if (container.orientation == Qt.Vertical) - ny = scrollArea.visibleArea.yPosition * container.height; - else - ny = scrollArea.visibleArea.xPosition * container.width; - if (ny > 2) return ny; else return 2; - } - - function size() - { - var nh, ny; - - if (container.orientation == Qt.Vertical) - nh = scrollArea.visibleArea.heightRatio * container.height; - else - nh = scrollArea.visibleArea.widthRatio * container.width; - - if (container.orientation == Qt.Vertical) - ny = scrollArea.visibleArea.yPosition * container.height; - else - ny = scrollArea.visibleArea.xPosition * container.width; - - if (ny > 3) { - var t; - if (container.orientation == Qt.Vertical) - t = Math.ceil(container.height - 3 - ny); - else - t = Math.ceil(container.width - 3 - ny); - if (nh > t) return t; else return nh; - } else return nh + ny; - } - - Rectangle { anchors.fill: parent; color: "Black"; opacity: 0.3 } - - BorderImage { - source: "images/scrollbar.png" - border { left: 1; right: 1; top: 1; bottom: 1 } - x: container.orientation == Qt.Vertical ? 2 : position() - width: container.orientation == Qt.Vertical ? container.width - 4 : size() - y: container.orientation == Qt.Vertical ? position() : 2 - height: container.orientation == Qt.Vertical ? size() : container.height - 4 - } - - states: State { - name: "visible" - when: container.orientation == Qt.Vertical ? scrollArea.movingVertically : scrollArea.movingHorizontally - PropertyChanges { target: container; opacity: 1.0 } - } - - transitions: Transition { - from: "visible"; to: "" - NumberAnimation { properties: "opacity"; duration: 600 } - } -} diff --git a/examples/declarative/rssnews/qml/rssnews/content/images/busy.png b/examples/declarative/rssnews/qml/rssnews/content/images/busy.png deleted file mode 100644 index 664c2b14..00000000 Binary files a/examples/declarative/rssnews/qml/rssnews/content/images/busy.png and /dev/null differ diff --git a/examples/declarative/rssnews/qml/rssnews/content/images/scrollbar.png b/examples/declarative/rssnews/qml/rssnews/content/images/scrollbar.png deleted file mode 100644 index 0228dcf9..00000000 Binary files a/examples/declarative/rssnews/qml/rssnews/content/images/scrollbar.png and /dev/null differ diff --git a/examples/declarative/rssnews/qml/rssnews/rssnews.qml b/examples/declarative/rssnews/qml/rssnews/rssnews.qml deleted file mode 100644 index e39e2f75..00000000 --- a/examples/declarative/rssnews/qml/rssnews/rssnews.qml +++ /dev/null @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "content" - -Rectangle { - id: window - width: 800; height: 480 - - property string currentFeed: "rss.news.yahoo.com/rss/topstories" - property bool loading: feedModel.status == XmlListModel.Loading - - RssFeeds { id: rssFeeds } - - XmlListModel { - id: feedModel - source: "http://" + window.currentFeed - query: "/rss/channel/item" - - XmlRole { name: "title"; query: "title/string()" } - XmlRole { name: "link"; query: "link/string()" } - XmlRole { name: "description"; query: "description/string()" } - } - - Row { - Rectangle { - width: 220; height: window.height - color: "#efefef" - - ListView { - focus: true - id: categories - anchors.fill: parent - model: rssFeeds - footer: quitButtonDelegate - delegate: CategoryDelegate {} - highlight: Rectangle { color: "steelblue" } - highlightMoveSpeed: 9999999 - } - ScrollBar { - scrollArea: categories; height: categories.height; width: 8 - anchors.right: categories.right - } - } - ListView { - id: list - width: window.width - 220; height: window.height - model: feedModel - delegate: NewsDelegate {} - } - } - Component { - id: quitButtonDelegate - Item { - width: categories.width; height: 60 - Text { - text: "Quit" - font { family: "Helvetica"; pixelSize: 16; bold: true } - anchors { - left: parent.left; leftMargin: 15 - verticalCenter: parent.verticalCenter - } - } - MouseArea { - anchors.fill: parent - onClicked: Qt.quit() - } - } - } - ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right } - Rectangle { x: 220; height: window.height; width: 1; color: "#cccccc" } -} diff --git a/examples/declarative/rssnews/rssnews.desktop b/examples/declarative/rssnews/rssnews.desktop deleted file mode 100644 index 7d02ed5f..00000000 --- a/examples/declarative/rssnews/rssnews.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=rssnews -Exec=/opt/rssnews/bin/rssnews -Icon=rssnews64 -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/rssnews/rssnews.pro b/examples/declarative/rssnews/rssnews.pro deleted file mode 100644 index 57b81fe6..00000000 --- a/examples/declarative/rssnews/rssnews.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/rssnews -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/rssnews -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/rssnews/rssnews.qmlproject b/examples/declarative/rssnews/rssnews.qmlproject deleted file mode 100644 index 608be8d3..00000000 --- a/examples/declarative/rssnews/rssnews.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/rssnews" - } - JavaScriptFiles { - directory: "qml/rssnews" - } - ImageFiles { - directory: "qml/rssnews" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/rssnews/rssnews.svg b/examples/declarative/rssnews/rssnews.svg deleted file mode 100644 index 566acfad..00000000 --- a/examples/declarative/rssnews/rssnews.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/rssnews/rssnews64.png b/examples/declarative/rssnews/rssnews64.png deleted file mode 100644 index 707d5c4e..00000000 Binary files a/examples/declarative/rssnews/rssnews64.png and /dev/null differ diff --git a/examples/declarative/rssnews/rssnews80.png b/examples/declarative/rssnews/rssnews80.png deleted file mode 100644 index 6ad8096c..00000000 Binary files a/examples/declarative/rssnews/rssnews80.png and /dev/null differ diff --git a/examples/declarative/rssnews/rssnews_harmattan.desktop b/examples/declarative/rssnews/rssnews_harmattan.desktop deleted file mode 100644 index df6303ff..00000000 --- a/examples/declarative/rssnews/rssnews_harmattan.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=rssnews -Exec=/usr/bin/single-instance /opt/rssnews/bin/rssnews -Icon=/usr/share/icons/hicolor/80x80/apps/rssnews80.png -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/samegame/main.cpp b/examples/declarative/samegame/main.cpp deleted file mode 100644 index 27978404..00000000 --- a/examples/declarative/samegame/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QmlApplicationViewer viewer; - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/samegame/samegame.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml b/examples/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml deleted file mode 100644 index 0e3b41cc..00000000 --- a/examples/declarative/samegame/qml/samegame/SamegameCore/BoomBlock.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 -import Qt.labs.particles 1.0 - -Item { - id: block - property bool dying: false - property bool spawned: false - property int type: 0 - - Behavior on x { - enabled: spawned; - SpringAnimation{ spring: 2; damping: 0.2 } - } - Behavior on y { - SpringAnimation{ spring: 2; damping: 0.2 } - } - - Image { - id: img - source: { - if(type == 0){ - "pics/redStone.png"; - } else if(type == 1) { - "pics/blueStone.png"; - } else { - "pics/greenStone.png"; - } - } - opacity: 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - anchors.fill: parent - } - - Particles { - id: particles - - width: 1; height: 1 - anchors.centerIn: parent - - emissionRate: 0 - lifeSpan: 700; lifeSpanDeviation: 600 - angle: 0; angleDeviation: 360; - velocity: 100; velocityDeviation: 30 - source: { - if(type == 0){ - "pics/redStar.png"; - } else if (type == 1) { - "pics/blueStar.png"; - } else { - "pics/greenStar.png"; - } - } - } - - states: [ - State { - name: "AliveState"; when: spawned == true && dying == false - PropertyChanges { target: img; opacity: 1 } - }, - - State { - name: "DeathState"; when: dying == true - StateChangeScript { script: particles.burst(50); } - PropertyChanges { target: img; opacity: 0 } - StateChangeScript { script: block.destroy(1000); } - } - ] -} diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/Button.qml b/examples/declarative/samegame/qml/samegame/SamegameCore/Button.qml deleted file mode 100644 index 1b9da226..00000000 --- a/examples/declarative/samegame/qml/samegame/SamegameCore/Button.qml +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 - -Rectangle { - id: container - - property string text: "Button" - - signal clicked - - width: buttonLabel.width + 20; height: buttonLabel.height + 20 - smooth: true - border { width: 1; color: Qt.darker(activePalette.button) } - radius: 8 - color: activePalette.button - - gradient: Gradient { - GradientStop { - position: 0.0 - color: { - if (mouseArea.pressed) - return activePalette.dark - else - return activePalette.light - } - } - GradientStop { position: 1.0; color: activePalette.button } - } - - MouseArea { id: mouseArea; anchors.fill: parent; onClicked: container.clicked() } - - Text { - id: buttonLabel; text: container.text; anchors.centerIn: container; color: activePalette.buttonText; font.pixelSize: 24 - } -} diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml b/examples/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml deleted file mode 100644 index a7e02244..00000000 --- a/examples/declarative/samegame/qml/samegame/SamegameCore/Dialog.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 - -Rectangle { - id: page - - property Item text: dialogText - - signal closed - signal opened - function forceClose() { - if(page.opacity == 0) - return; //already closed - page.closed(); - page.opacity = 0; - } - - function show(txt) { - page.opened(); - dialogText.text = txt; - page.opacity = 1; - } - - width: dialogText.width + 20; height: dialogText.height + 20 - color: "white" - border.width: 1 - opacity: 0 - visible: opacity > 0 - Behavior on opacity { - NumberAnimation { duration: 1000 } - } - - Text { id: dialogText; anchors.centerIn: parent; text: "Hello World!" } - - MouseArea { anchors.fill: parent; onClicked: forceClose(); } -} - diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/background.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/background.png deleted file mode 100644 index 3734a277..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/background.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png deleted file mode 100644 index ff9588f8..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStar.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png deleted file mode 100644 index 20e43c75..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/blueStone.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png deleted file mode 100644 index cd068547..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStar.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png deleted file mode 100644 index b568a190..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/greenStone.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png deleted file mode 100644 index 0a4dffe5..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStar.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png deleted file mode 100644 index 36b09a26..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/redStone.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/star.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/star.png deleted file mode 100644 index defbde53..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/star.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png b/examples/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png deleted file mode 100644 index b1ce7621..00000000 Binary files a/examples/declarative/samegame/qml/samegame/SamegameCore/pics/yellowStone.png and /dev/null differ diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/qmldir b/examples/declarative/samegame/qml/samegame/SamegameCore/qmldir deleted file mode 100644 index e17b1f5d..00000000 --- a/examples/declarative/samegame/qml/samegame/SamegameCore/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -BoomBlock BoomBlock.qml -Button Button.qml -Dialog Dialog.qml diff --git a/examples/declarative/samegame/qml/samegame/SamegameCore/samegame.js b/examples/declarative/samegame/qml/samegame/SamegameCore/samegame.js deleted file mode 100644 index d7b827a1..00000000 --- a/examples/declarative/samegame/qml/samegame/SamegameCore/samegame.js +++ /dev/null @@ -1,288 +0,0 @@ -/* This script file handles the game logic */ - -var maxColumn = 10; -var maxRow = 15; -var maxIndex = maxColumn*maxRow; -var board = new Array(maxIndex); -var blockSrc = "SamegameCore/BoomBlock.qml"; -var scoresURL = ""; -var gameDuration; -var component = Qt.createComponent(blockSrc); -var highScoreBar = 0; - -// Index function used instead of a 2D array -function index(column, row) -{ - 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 startNewGame() -{ - // Delete blocks from previous game - for (var i = 0; i < maxIndex; i++) { - if (board[i] != null) - board[i].destroy(); - } - - // Calculate board size - maxColumn = Math.floor(gameCanvas.width/gameCanvas.blockSize); - maxRow = Math.floor(gameCanvas.height/gameCanvas.blockSize); - maxIndex = maxRow * maxColumn; - - // Close dialogs - nameInputDialog.forceClose(); - dialog.forceClose(); - - // Initialize Board - board = new Array(maxIndex); - gameCanvas.score = 0; - for (var column = 0; column < maxColumn; column++) { - for (var row = 0; row < maxRow; row++) { - board[index(column, row)] = null; - createBlock(column, row); - } - } - 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) -{ - 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; - gameCanvas.score += (fillFound - 1) * (fillFound - 1); - shuffleDown(); - victoryCheck(); -} - -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 victoryCheck() -{ - // Awards bonuses for no blocks left - var deservesBonus = true; - for (var column = maxColumn - 1; column >= 0; column--) - if (board[index(column, maxRow - 1)] != null) - deservesBonus = false; - if (deservesBonus) - gameCanvas.score += 500; - // Checks for game over - if (deservesBonus || !(floodMoveCheck(0, maxRow - 1, -1))) { - gameDuration = new Date() - gameDuration; - if(gameCanvas.score > highScoreBar){ - nameInputDialog.show("You won! Please enter your name: "); - nameInputDialog.initialWidth = nameInputDialog.text.width + 20; - if (nameInputDialog.name == "") - nameInputDialog.width = nameInputDialog.initialWidth; - nameInputDialog.text.opacity = 0; // Just a spacer - }else{ - dialog.show("You won!"); - } - } -} - -// Only floods up and right, to see if it can find adjacent same-typed blocks -function floodMoveCheck(column, row, type) -{ - 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; - return floodMoveCheck(column + 1, row, myType) || - floodMoveCheck(column, row - 1, board[index(column, row)].type); -} - -function createBlock(column,row) -{ - // 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 == Component.Ready){ - var dynamicObject = component.createObject(gameCanvas, - {"type": Math.floor(Math.random() * 3), - "x": column*gameCanvas.blockSize, - "width": gameCanvas.blockSize, - "height": gameCanvas.blockSize}); - 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 initHighScoreBar() -{ - if(scoresURL != "") - return true;//don't query remote scores - var db = openDatabaseSync( - "SameGameScores", - "1.0", - "Local SameGame High Scores", - 100 - ); - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); - // Only show results for the current grid size - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "' - + maxColumn + "x" + maxRow + '" ORDER BY score desc LIMIT 10'); - if(rs.rows.length < 10) - highScoreBar = 0; - else - highScoreBar = rs.rows.item(rs.rows.length - 1).score; - } - ); -} - -function saveHighScore(name) -{ - if (scoresURL != "") - sendHighScore(name); - // Offline storage - var db = openDatabaseSync( - "SameGameScores", - "1.0", - "Local SameGame High Scores", - 100 - ); - var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; - var data = [ - name, - gameCanvas.score, - maxColumn + "x" + maxRow, - Math.floor(gameDuration / 1000) - ]; - db.transaction( - function(tx) { - tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); - tx.executeSql(dataStr, data); - - // Only show results for the current grid size - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "' - + maxColumn + "x" + maxRow + '" ORDER BY score desc LIMIT 10'); - var r = "\nHIGH SCORES for this grid size\n\n" - for (var i = 0; i < rs.rows.length; i++) { - r += (i+1) + ". " + rs.rows.item(i).name + ' got ' - + rs.rows.item(i).score + ' points in ' - + rs.rows.item(i).time + ' seconds.\n'; - } - if(rs.rows.length == 10) - highScoreBar = rs.rows.item(9).score; - dialog.show(r); - } - ); -} - -function sendHighScore(name) -{ - var postman = new XMLHttpRequest() - var postData = "name=" + name + "&score=" + gameCanvas.score - + "&gridSize=" + maxColumn + "x" + maxRow - + "&time=" + Math.floor(gameDuration / 1000); - postman.open("POST", scoresURL, true); - postman.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - postman.onreadystatechange = function() { - if (postman.readyState == postman.DONE) { - dialog.show("Your score has been uploaded."); - } - } - postman.send(postData); -} diff --git a/examples/declarative/samegame/qml/samegame/highscores/README b/examples/declarative/samegame/qml/samegame/highscores/README deleted file mode 100644 index eaa00fae..00000000 --- a/examples/declarative/samegame/qml/samegame/highscores/README +++ /dev/null @@ -1 +0,0 @@ -The SameGame example can interface with a simple PHP script to store XML high score data on a remote server. We do not have a publically accessible server available for this use, but if you have access to a PHP capable webserver you can copy the files (score_data.xml, score.php, score_style.xsl) to it and alter the highscore_server variable at the top of the samegame.js file to point to it. diff --git a/examples/declarative/samegame/qml/samegame/highscores/score_data.xml b/examples/declarative/samegame/qml/samegame/highscores/score_data.xml deleted file mode 100644 index c3fd90d9..00000000 --- a/examples/declarative/samegame/qml/samegame/highscores/score_data.xml +++ /dev/null @@ -1,2 +0,0 @@ -1000000Alan the Tester0x00 -6213Alan12x1751 diff --git a/examples/declarative/samegame/qml/samegame/highscores/score_style.xsl b/examples/declarative/samegame/qml/samegame/highscores/score_style.xsl deleted file mode 100644 index 670354c9..00000000 --- a/examples/declarative/samegame/qml/samegame/highscores/score_style.xsl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - SameGame High Scores - -

SameGame High Scores

- - - - - - - - - - - - - - - - -
NameScoreGrid SizeTime, s
- - -
-
diff --git a/examples/declarative/samegame/qml/samegame/highscores/scores.php b/examples/declarative/samegame/qml/samegame/highscores/scores.php deleted file mode 100644 index 3cceb2d7..00000000 --- a/examples/declarative/samegame/qml/samegame/highscores/scores.php +++ /dev/null @@ -1,34 +0,0 @@ -"; - echo "SameGame High Scores"; - if($score > 0){#Sending in a new high score - $name = $_POST["name"]; - $grid = $_POST["gridSize"]; - $time = $_POST["time"]; - if($name == "") - $name = "Anonymous"; - //if($grid != "10x10"){ - //Need a standard, so as to reject others? - //} - $file = fopen("score_data.xml", "a"); #It's XML. Happy? - $ret = fwrite($file, "". $score . "" - . $name . "" . $grid . "" - . $time . "\n"); - echo "Your score has been recorded. Thanks for playing!"; - if($ret == False) - echo "
There was an error though, so don't expect to see that score again."; - }else{#Read high score list - #Now uses XSLT to display. So just print the file. With XML cruft added. - #Note that firefox at least won't apply the XSLT on a php file. So redirecting - $file = fopen("scores.xml", "w"); - $ret = fwrite($file, '' . "\n" - . '' . "\n" - . "\n" . file_get_contents("score_data.xml") . "\n"); - if($ret == False) - echo "There was an internal error. Sorry."; - else - echo ''; - } - echo ""; -?> diff --git a/examples/declarative/samegame/qml/samegame/samegame.qml b/examples/declarative/samegame/qml/samegame/samegame.qml deleted file mode 100644 index db8016fc..00000000 --- a/examples/declarative/samegame/qml/samegame/samegame.qml +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.1 -import "SamegameCore" -import "SamegameCore/samegame.js" as Logic - -Rectangle { - id: screen - width: 490; height: 720 - property bool inAnotherDemo: false //Samegame often is just plonked straight into other demos - - SystemPalette { id: activePalette } - - Item { - width: parent.width - anchors { top: parent.top; bottom: toolBar.top } - - Image { - id: background - anchors.fill: parent - source: "SamegameCore/pics/background.png" - fillMode: Image.PreserveAspectCrop - } - - Item { - id: gameCanvas - property int score: 0 - property int blockSize: 40 - - z: 20; anchors.centerIn: parent - width: parent.width - (parent.width % blockSize); - height: parent.height - (parent.height % blockSize); - - MouseArea { - anchors.fill: parent; onClicked: Logic.handleClick(mouse.x,mouse.y); - } - } - } - - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } - - Dialog { - id: nameInputDialog - - property int initialWidth: 0 - property alias name: nameInputText.text - - anchors.centerIn: parent - z: 22; - - Behavior on width { - NumberAnimation {} - enabled: nameInputDialog.initialWidth != 0 - } - - onClosed: { - if (nameInputText.text != "") - Logic.saveHighScore(nameInputText.text); - } - Text { - id: dialogText - anchors { left: nameInputDialog.left; leftMargin: 20; verticalCenter: parent.verticalCenter } - text: "You won! Please enter your name: " - } - MouseArea { - anchors.fill: parent - onClicked: { - if (nameInputText.text == "") - nameInputText.openSoftwareInputPanel(); - else - nameInputDialog.forceClose(); - } - } - - TextInput { - id: nameInputText - anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - focus: visible - autoScroll: false - maximumLength: 24 - onTextChanged: { - var newWidth = nameInputText.width + dialogText.width + 40; - if ( (newWidth > nameInputDialog.width && newWidth < screen.width) - || (nameInputDialog.width > nameInputDialog.initialWidth) ) - nameInputDialog.width = newWidth; - } - onAccepted: { - nameInputDialog.forceClose(); - } - } - } - - Rectangle { - id: toolBar - width: parent.width; height: 58 - color: activePalette.window - anchors.bottom: screen.bottom - - Button { - id: newGameButton - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } - text: "New Game" - onClicked: Logic.startNewGame() - } - - Button { - visible: !inAnotherDemo - text: "Quit" - anchors { left: newGameButton.right; leftMargin: 3; verticalCenter: parent.verticalCenter } - onClicked: Qt.quit(); - } - - Text { - id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } - text: "Score: " + gameCanvas.score - font.bold: true - font.pixelSize: 24 - color: activePalette.windowText - } - } -} diff --git a/examples/declarative/samegame/samegame.desktop b/examples/declarative/samegame/samegame.desktop deleted file mode 100644 index 18ad2d98..00000000 --- a/examples/declarative/samegame/samegame.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=samegame -Exec=/opt/samegame/bin/samegame -Icon=samegame64 -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/samegame/samegame.pro b/examples/declarative/samegame/samegame.pro deleted file mode 100644 index baac5dc1..00000000 --- a/examples/declarative/samegame/samegame.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/samegame -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/samegame -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/samegame/samegame.qmlproject b/examples/declarative/samegame/samegame.qmlproject deleted file mode 100644 index c17ee1ee..00000000 --- a/examples/declarative/samegame/samegame.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/samegame" - } - JavaScriptFiles { - directory: "qml/samegame" - } - ImageFiles { - directory: "qml/samegame" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/samegame/samegame.svg b/examples/declarative/samegame/samegame.svg deleted file mode 100644 index 566acfad..00000000 --- a/examples/declarative/samegame/samegame.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/samegame/samegame64.png b/examples/declarative/samegame/samegame64.png deleted file mode 100644 index 707d5c4e..00000000 Binary files a/examples/declarative/samegame/samegame64.png and /dev/null differ diff --git a/examples/declarative/samegame/samegame80.png b/examples/declarative/samegame/samegame80.png deleted file mode 100644 index 6ad8096c..00000000 Binary files a/examples/declarative/samegame/samegame80.png and /dev/null differ diff --git a/examples/declarative/samegame/samegame_harmattan.desktop b/examples/declarative/samegame/samegame_harmattan.desktop deleted file mode 100644 index 1f35b8e3..00000000 --- a/examples/declarative/samegame/samegame_harmattan.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=samegame -Exec=/usr/bin/single-instance /opt/samegame/bin/samegame -Icon=/usr/share/icons/hicolor/80x80/apps/samegame80.png -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/snake/main.cpp b/examples/declarative/snake/main.cpp deleted file mode 100644 index cea869c1..00000000 --- a/examples/declarative/snake/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QmlApplicationViewer viewer; - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/snake/snake.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/snake/qml/snake/content/Button.qml b/examples/declarative/snake/qml/snake/content/Button.qml deleted file mode 100644 index 322431d3..00000000 --- a/examples/declarative/snake/qml/snake/content/Button.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: container - - signal clicked - property string text: "Button" - - color: activePalette.button; smooth: true - width: txtItem.width + 20; height: txtItem.height + 6 - border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; - - gradient: Gradient { - GradientStop { - id: topGrad; position: 0.0 - color: if (mr.pressed) { activePalette.dark } else { activePalette.light } } - GradientStop { position: 1.0; color: activePalette.button } - } - - MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() } - - Text { - id: txtItem; text: container.text; anchors.centerIn: container; color: activePalette.buttonText - } -} diff --git a/examples/declarative/snake/qml/snake/content/Cookie.qml b/examples/declarative/snake/qml/snake/content/Cookie.qml deleted file mode 100644 index d101445a..00000000 --- a/examples/declarative/snake/qml/snake/content/Cookie.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt.labs.particles 1.0 - -Item { - id: root - property bool dying: false - property int row; - property int column; - x: margin + column * gridSize - y: margin + row * gridSize - - width: gridSize - height: gridSize - property int value : 1; - - Image { - id: img - anchors.fill: parent - source: "pics/cookie.png" - opacity: 0 - Text { - font.bold: true - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - text: value - } - } - - Particles { id: particles - width:1; height:1; anchors.centerIn: parent; - emissionRate: 0; - lifeSpan: 700; lifeSpanDeviation: 600; - angle: 0; angleDeviation: 360; - velocity: 100; velocityDeviation:30; - source: "pics/yellowStar.png"; - } - - states: [ - State{ name: "AliveState"; when: dying == false - PropertyChanges { target: img; opacity: 1 } - }, - State{ name: "DeathState"; when: dying == true - StateChangeScript { script: particles.burst(50); } - PropertyChanges { target: img; opacity: 0 } - } - ] - transitions: [ - Transition { - NumberAnimation { target: img; property: "opacity"; duration: 100 } - } - ] -} diff --git a/examples/declarative/snake/qml/snake/content/HighScoreModel.qml b/examples/declarative/snake/qml/snake/content/HighScoreModel.qml deleted file mode 100644 index c9a81831..00000000 --- a/examples/declarative/snake/qml/snake/content/HighScoreModel.qml +++ /dev/null @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -// Models a high score table. -// -// Use this component like this: -// -// HighScoreModel { -// id: highScores -// game: "MyCoolGame" -// } -// -// Then use either use the top-score properties: -// -// Text { text: "HI: " + highScores.topScore } -// -// or, use the model in a view: -// -// ListView { -// model: highScore -// delegate: Component { -// ... player ... score ... -// } -// } -// -// Add new scores via: -// -// saveScore(newScore) -// -// or: -// -// savePlayerScore(playerName,newScore) -// -// The best maxScore scores added by this method will be retained in an SQL database, -// and presented in the model and in the topScore/topPlayer properties. -// - -ListModel { - id: model - property string game: "" - property int topScore: 0 - property string topPlayer: "" - property int maxScores: 10 - - function __db() - { - return openDatabaseSync("HighScoreModel", "1.0", "Generic High Score Functionality for QML", 1000000); - } - function __ensureTables(tx) - { - tx.executeSql('CREATE TABLE IF NOT EXISTS HighScores(game TEXT, score INT, player TEXT)', []); - } - - function fillModel() { - __db().transaction( - function(tx) { - __ensureTables(tx); - var rs = tx.executeSql("SELECT score,player FROM HighScores WHERE game=? ORDER BY score DESC", [game]); - model.clear(); - if (rs.rows.length > 0) { - topScore = rs.rows.item(0).score - topPlayer = rs.rows.item(0).player - for (var i=0; i maxScores) - tx.executeSql("DELETE FROM HighScores WHERE game=? AND score <= ?", - [game, rs.rows.item(maxScores).score]); - } - } - ) - } - - function savePlayerScore(player,score) { - __db().transaction( - function(tx) { - __ensureTables(tx); - tx.executeSql("INSERT INTO HighScores VALUES(?,?,?)", [game,score,player]); - fillModel(); - } - ) - } - - function saveScore(score) { - savePlayerScore("player",score); - } - - function clearScores() { - __db().transaction( - function(tx) { - tx.executeSql("DELETE FROM HighScores WHERE game=?", [game]); - fillModel(); - } - ) - } - - Component.onCompleted: { fillModel() } -} diff --git a/examples/declarative/snake/qml/snake/content/Link.qml b/examples/declarative/snake/qml/snake/content/Link.qml deleted file mode 100644 index f5658e95..00000000 --- a/examples/declarative/snake/qml/snake/content/Link.qml +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import Qt.labs.particles 1.0 - -Item { id:link - property bool dying: false - property bool spawned: false - property int type: 0 - property int row: 0 - property int column: 0 - property int rotation; - - width: 40; - height: 40 - - x: margin - 3 + gridSize * column - y: margin - 3 + gridSize * row - Behavior on x { NumberAnimation { duration: spawned ? heartbeatInterval : 0} } - Behavior on y { NumberAnimation { duration: spawned ? heartbeatInterval : 0 } } - - - Item { - id: img - anchors.fill: parent - Image { - source: { - if(type == 1) { - "pics/blueStone.png"; - } else if (type == 2) { - "pics/head.png"; - } else { - "pics/redStone.png"; - } - } - - transform: Rotation { - id: actualImageRotation - origin.x: width/2; origin.y: height/2; - angle: rotation * 90 - Behavior on angle { - RotationAnimation{ - direction: RotationAnimation.Shortest - duration: spawned ? 200 : 0 - } - } - } - } - - Image { - source: "pics/stoneShadow.png" - } - - opacity: 0 - } - - - Particles { id: particles - width:1; height:1; anchors.centerIn: parent; - emissionRate: 0; - lifeSpan: 700; lifeSpanDeviation: 600; - angle: 0; angleDeviation: 360; - velocity: 100; velocityDeviation:30; - source: { - if(type == 1){ - "pics/blueStar.png"; - } else { - "pics/redStar.png"; - } - } - } - - states: [ - State{ name: "AliveState"; when: spawned == true && dying == false - PropertyChanges { target: img; opacity: 1 } - }, - State{ name: "DeathState"; when: dying == true - StateChangeScript { script: particles.burst(50); } - PropertyChanges { target: img; opacity: 0 } - } - ] - - transitions: [ - Transition { - NumberAnimation { target: img; property: "opacity"; duration: 200 } - } - ] - -} diff --git a/examples/declarative/snake/qml/snake/content/Skull.qml b/examples/declarative/snake/qml/snake/content/Skull.qml deleted file mode 100644 index 4242b708..00000000 --- a/examples/declarative/snake/qml/snake/content/Skull.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Image { - property bool spawned: false - property int row; - property int column; - property int verticalMovement; - property int horizontalMovement; - - x: margin + column * gridSize + 2 - y: margin + row * gridSize - 3 - Behavior on x { NumberAnimation { duration: spawned ? halfbeatInterval : 0} } - Behavior on y { NumberAnimation { duration: spawned ? halfbeatInterval : 0 } } - - opacity: spawned ? 1 : 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - - source: "pics/skull.png" - width: 24 - height: 40 -} diff --git a/examples/declarative/snake/qml/snake/content/pics/README b/examples/declarative/snake/qml/snake/content/pics/README deleted file mode 100644 index 0215132c..00000000 --- a/examples/declarative/snake/qml/snake/content/pics/README +++ /dev/null @@ -1 +0,0 @@ -snake.jpg: This image is based on the picture "Eastern Green Mamba.jpg" from the free media databse Wikimedia Commons and is published under the terms of the GNU Free Documentation License. The original picture was taken by Danleo. diff --git a/examples/declarative/snake/qml/snake/content/pics/background.png b/examples/declarative/snake/qml/snake/content/pics/background.png deleted file mode 100644 index 72dffaa8..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/background.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/blueStar.png b/examples/declarative/snake/qml/snake/content/pics/blueStar.png deleted file mode 100644 index ba7acabd..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/blueStar.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/blueStone.png b/examples/declarative/snake/qml/snake/content/pics/blueStone.png deleted file mode 100644 index 356affdd..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/blueStone.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/cookie.png b/examples/declarative/snake/qml/snake/content/pics/cookie.png deleted file mode 100644 index aec2957f..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/cookie.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/eyes.svg b/examples/declarative/snake/qml/snake/content/pics/eyes.svg deleted file mode 100644 index 10786927..00000000 --- a/examples/declarative/snake/qml/snake/content/pics/eyes.svg +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - diff --git a/examples/declarative/snake/qml/snake/content/pics/head.png b/examples/declarative/snake/qml/snake/content/pics/head.png deleted file mode 100644 index 550e0026..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/head.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/head.svg b/examples/declarative/snake/qml/snake/content/pics/head.svg deleted file mode 100644 index 3bf0bd2f..00000000 --- a/examples/declarative/snake/qml/snake/content/pics/head.svg +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/examples/declarative/snake/qml/snake/content/pics/pause.png b/examples/declarative/snake/qml/snake/content/pics/pause.png deleted file mode 100644 index 056d97dd..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/pause.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/redStar.png b/examples/declarative/snake/qml/snake/content/pics/redStar.png deleted file mode 100644 index cd068547..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/redStar.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/redStone.png b/examples/declarative/snake/qml/snake/content/pics/redStone.png deleted file mode 100644 index 9bb7fe42..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/redStone.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/skull.png b/examples/declarative/snake/qml/snake/content/pics/skull.png deleted file mode 100644 index 63186167..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/skull.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/snake.jpg b/examples/declarative/snake/qml/snake/content/pics/snake.jpg deleted file mode 100644 index e91a784f..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/snake.jpg and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/star.png b/examples/declarative/snake/qml/snake/content/pics/star.png deleted file mode 100644 index defbde53..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/star.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/stoneShadow.png b/examples/declarative/snake/qml/snake/content/pics/stoneShadow.png deleted file mode 100644 index 1bd56afd..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/stoneShadow.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/yellowStar.png b/examples/declarative/snake/qml/snake/content/pics/yellowStar.png deleted file mode 100644 index 52fb9c4b..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/yellowStar.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/pics/yellowStone.png b/examples/declarative/snake/qml/snake/content/pics/yellowStone.png deleted file mode 100644 index c56124a8..00000000 Binary files a/examples/declarative/snake/qml/snake/content/pics/yellowStone.png and /dev/null differ diff --git a/examples/declarative/snake/qml/snake/content/snake.js b/examples/declarative/snake/qml/snake/content/snake.js deleted file mode 100644 index 837b82ad..00000000 --- a/examples/declarative/snake/qml/snake/content/snake.js +++ /dev/null @@ -1,316 +0,0 @@ - -var snake = new Array; -var board = new Array; -var links = new Array; -var scheduledDirections = new Array; -var numRows = 1; -var numColumns = 1; -var linkComponent = Qt.createComponent("content/Link.qml"); // XXX should resolve relative to script, not component -var cookieComponent = Qt.createComponent("content/Cookie.qml"); -var cookie; -var linksToGrow = 0; -var linksToDie = 0; -var waitForCookie = 0; -var growType = 0; -var skullMovementsBeforeDirectionChange = 0; - - -function rand(n) -{ - return (Math.floor(Math.random() * n)); -} - -function scheduleDirection(dir) -{ - if (state == "starting") { - direction = dir; - headDirection = direction; - head.rotation = headDirection; - } else if (state == "running"){ - direction = dir; - if(scheduledDirections[scheduledDirections.length-1]!=direction) - scheduledDirections.push(direction); - } -} - -function startNewGame() -{ - if (state == "starting") { - return; - } - - if (activeGame) { - endGame(); - startNewGameTimer.running = true; - return; - } - - state = "starting"; - - numRows = numRowsAvailable; - numColumns = numColumnsAvailable; - board = new Array(numRows * numColumns); - snake = new Array; - scheduledDirections = new Array; - growType = 0; - - skull.z = numRows * numColumns + 1; - - for (var i = 0; i < numRows * numColumns; ++i) { - if (i < links.length) { - var link = links[i]; - link.spawned = false; - link.dying = false; - } else { - if(linkComponent.status != Component.Ready) { - if(linkComponent.status == Component.Error) - console.log(linkComponent.errorString()); - else - console.log("Still loading linkComponent"); - continue;//TODO: Better error handling? - } - var link = linkComponent.createObject(playfield); - link.z = numRows * numColumns + 1 - i; - link.type = i == 0 ? 2 : 0; - link.spawned = false; - link.dying = false; - links.push(link); - } - } - - head = links[0]; - snake.push(head); - head.row = numRows/2 -1; - head.column = numColumns/2 -1; - head.spawned = true; - - linksToGrow = 5; - linksToDie = 0; - waitForCookie = 5; - score = 0; - startHeartbeatTimer.running = true; -} - -function endGame() -{ - activeGame = false; - for(var i in snake) - snake[i].dying = true; - if (cookie) { - cookie.dying = true; - cookie = 0; - } - lastScore = score; - highScores.saveScore(lastScore); - state = ""; -} - -function move() { - - if (!head) - return; - - var dir = direction; - - if (scheduledDirections.length) { - dir = scheduledDirections.shift(); - } - - if (state == "starting") { - var turn = (dir - headDirection); - head.rotation += turn == -3 ? 1 : (turn == 3 ? -1 : turn ); - headDirection = dir; - return; - } - - var row = head.row; - var column = head.column; - - if (dir == 0) { - row = row - 1; - } else if (dir == 1) { - column = column + 1 - } else if (dir == 2) { - row = row + 1; - } else if (dir == 3) { - column = column - 1; - } - - //validate the new position - if (row < 0 || row >= numRows - || column < 0 || column >= numColumns - || (row == skull.row && column == skull.column) - || !isFree(row, column)) { - var turn = (dir - headDirection); - head.rotation += turn == -3 ? 1 : (turn == 3 ? -1 : turn ); - headDirection = dir; - endGame(); - return; - } - - var newLink; - if (linksToGrow > 0) { - --linksToGrow; - newLink = links[snake.length]; - newLink.spawned = false; - newLink.rotation = snake[snake.length-1].rotation; - newLink.type = growType; - newLink.dying = false; - snake.push(newLink); - } else { - var lastLink = snake[snake.length-1]; - board[lastLink.row * numColumns + lastLink.column] = undefined; - } - - if (waitForCookie > 0) { - if (--waitForCookie == 0) - createCookie(cookie? (cookie.value+1) : 1); - } - - for (var i = snake.length-1; i > 0; --i) { - snake[i].row = snake[i-1].row; - snake[i].column = snake[i-1].column; - snake[i].rotation = snake[i-1].rotation; - } - - if (newLink) { - newLink.spawned = true; - } - - // move the head - head.row = row; - head.column = column; - board[row * numColumns + column] = head; - - var turn = (dir - headDirection); - head.rotation += turn == -3 ? 1 : (turn == 3 ? -1 : turn ); - headDirection = dir; - - var value = testCookie(row, column); - if (value > 0) { - linksToGrow += value; - score += value; - } -} - -function isFree(row, column) -{ - return board[row * numColumns + column] == undefined; -} - -function isHead(row, column) -{ - return head.column == column && head.row == row; -} - -function testCookie(row, column) -{ - if (cookie && !cookie.dying && cookie.row == row && cookie.column == column) { - var value = cookie.value; - waitForCookie = value; - growType = snake[snake.length-1].type == 1 ? 0 : 1; - cookie.dying = true; - cookie.z = numRows * numColumns + 2; - return value; - } - return 0; -} - -function moveSkull() -{ - - if (linksToDie > 0) { - --linksToDie; - var link = snake.pop(); - link.dying = true; - board[link.row * numColumns + link.column] = undefined; - if (score > 0) - --score; - if (snake.length == 0) { - endGame(); - return; - } - } - - var row = skull.row; - var column = skull.column; - if (isHead(row, column)) { - endGame(); - return; - } - row += skull.verticalMovement; - column += skull.horizontalMovement; - - var attempts = 4; - - while (skullMovementsBeforeDirectionChange == 0 || row < 0 || row >= numRows - || column < 0 || column >= numColumns - || (!isFree(row, column) && !isHead(row, column))) { - var d = rand(8); - skull.verticalMovement = 0; - skull.horizontalMovement = 0; - skullMovementsBeforeDirectionChange = rand(20)+1; - if (d == 0) { - skull.verticalMovement = -1 - } else if (d == 1) { - skull.horizontalMovement = -1; - } else if (d == 2) { - skull.verticalMovement = 1 - } else if (d == 3){ - skull.horizontalMovement = 1; - } else if (cookie) { - var rd = cookie.row - skull.row; - var rc = cookie.column - skull.column; - if (Math.abs(rd) > Math.abs(rc)) { - skull.verticalMovement = rd > 0 ? 1 : -1; - skullMovementsBeforeDirectionChange = Math.abs(rd); - } else { - skull.horizontalMovement= rc > 0 ? 1 : -1; - skullMovementsBeforeDirectionChange = Math.abs(rc); - } - } - row = skull.row + skull.verticalMovement; - column = skull.column + skull.horizontalMovement; - if (--attempts == 0) - return; - } - - skull.row = row; - skull.column = column; - --skullMovementsBeforeDirectionChange; - var value = testCookie(row, column); - if (value > 0) - linksToDie += value/2; - - if (isHead(row, column)) - endGame(); -} - -function createCookie(value) { - if (numRows * numColumns - snake.length < 10) - return; - - var column = rand(numColumns); - var row = rand(numRows); - while (!isFree(row, column)) { - column++; - if (column == numColumns) { - column = 0; - row++; - if (row == numRows) - row = 0; - } - } - - if(cookieComponent.status != Component.Ready) { - if(cookieComponent.status == Component.Error) - console.log(cookieComponent.errorString()); - else - console.log("Still loading cookieComponent"); - return;//TODO: Better error handling? - } - cookie = cookieComponent.createObject(head.parent); - cookie.value = value; - cookie.row = row; - cookie.column = column; -} diff --git a/examples/declarative/snake/qml/snake/snake.qml b/examples/declarative/snake/qml/snake/snake.qml deleted file mode 100644 index b5e386d6..00000000 --- a/examples/declarative/snake/qml/snake/snake.qml +++ /dev/null @@ -1,272 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "content" as Content -import "content/snake.js" as Logic - -Rectangle { - id: screen; - SystemPalette { id: activePalette } - color: activePalette.window - property bool activeGame: false - - property int gridSize : 34 - property int margin: 4 - property int numRowsAvailable: Math.floor((height-32-2*margin)/gridSize) - property int numColumnsAvailable: Math.floor((width-2*margin)/gridSize) - - property int lastScore : 0 - - property int score: 0; - property int heartbeatInterval: 200 - property int halfbeatInterval: 160 - - width: 480 - height: 750 - - property int direction - property int headDirection - - property variant head; - - Content.HighScoreModel { - id: highScores - game: "Snake" - } - - Timer { - id: heartbeat; - interval: heartbeatInterval; - running: activeGame - repeat: true - onTriggered: { Logic.move() } - } - Timer { - id: halfbeat; - interval: halfbeatInterval; - repeat: true - running: heartbeat.running - onTriggered: { Logic.moveSkull() } - } - Timer { - id: startNewGameTimer; - interval: 700; - onTriggered: { Logic.startNewGame(); } - } - - Timer { - id: startHeartbeatTimer; - interval: 1000 ; - onTriggered: { state = "running"; activeGame = true; } - } - - Image{ - id: pauseDialog - z: 1 - source: "content/pics/pause.png" - anchors.centerIn: parent; - //opacity is deliberately not animated - opacity: activeGame && !Qt.application.active - } - - Image { - - Image { - id: title - source: "content/pics/snake.jpg" - fillMode: Image.PreserveAspectCrop - anchors.fill: parent - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - - Column { - spacing: 140 - anchors.verticalCenter: parent.verticalCenter; - anchors.left: parent.left; - anchors.right: parent.right; - - Text { - color: "white" - font.pointSize: 48 - font.italic: true; - font.bold: true; - text: "Snake" - anchors.horizontalCenter: parent.horizontalCenter; - } - - Text { - color: "white" - font.pointSize: 24 - anchors.horizontalCenter: parent.horizontalCenter; - //horizontalAlignment: Text.AlignHCenter - text: "Last Score:\t" + lastScore + "\nHighscore:\t" + highScores.topScore; - } - } - } - - source: "content/pics/background.png" - fillMode: Image.PreserveAspectCrop - - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: toolbar.top - - Rectangle { - id: playfield - border.width: 1 - border.color: "white" - color: "transparent" - anchors.horizontalCenter: parent.horizontalCenter - y: (screen.height - 32 - height)/2; - width: numColumnsAvailable * gridSize + 2*margin - height: numRowsAvailable * gridSize + 2*margin - - - Content.Skull { - id: skull - } - - MouseArea { - anchors.fill: parent - onPressed: { - if (screen.state == "") { - Logic.startNewGame(); - return; - } - if (direction == 0 || direction == 2) - Logic.scheduleDirection((mouseX > (head.x + head.width/2)) ? 1 : 3); - else - Logic.scheduleDirection((mouseY > (head.y + head.height/2)) ? 2 : 0); - } - } - } - - } - - Rectangle { - id: progressBar - opacity: 0 - Behavior on opacity { NumberAnimation { duration: 200 } } - color: "transparent" - border.width: 2 - border.color: "#221edd" - x: 50 - y: 50 - width: 200 - height: 30 - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 40 - - Rectangle { - id: progressIndicator - color: "#221edd"; - width: 0; - height: 30; - } - } - - Rectangle { - id: toolbar - color: activePalette.window - height: 32; width: parent.width - anchors.bottom: screen.bottom - - Content.Button { - id: btnA; text: "New Game"; onClicked: Logic.startNewGame(); - anchors.left: parent.left; anchors.leftMargin: 3 - anchors.verticalCenter: parent.verticalCenter - } - - Content.Button { - text: "Quit" - anchors { left: btnA.right; leftMargin: 3; verticalCenter: parent.verticalCenter } - onClicked: Qt.quit(); - } - - Text { - color: activePalette.text - text: "Score: " + score; font.bold: true - anchors.right: parent.right; anchors.rightMargin: 3 - anchors.verticalCenter: parent.verticalCenter - } - } - - focus: true - Keys.onSpacePressed: Logic.startNewGame(); - Keys.onLeftPressed: if (state == "starting" || direction != 1) Logic.scheduleDirection(3); - Keys.onRightPressed: if (state == "starting" || direction != 3) Logic.scheduleDirection(1); - Keys.onUpPressed: if (state == "starting" || direction != 2) Logic.scheduleDirection(0); - Keys.onDownPressed: if (state == "starting" || direction != 0) Logic.scheduleDirection(2); - - states: [ - State { - name: "starting" - PropertyChanges {target: progressIndicator; width: 200} - PropertyChanges {target: title; opacity: 0} - PropertyChanges {target: progressBar; opacity: 1} - }, - State { - name: "running" - PropertyChanges {target: progressIndicator; width: 200} - PropertyChanges {target: title; opacity: 0} - PropertyChanges {target: skull; row: 0; column: 0; } - PropertyChanges {target: skull; spawned: 1} - } - ] - - transitions: [ - Transition { - from: "*" - to: "starting" - NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 } - NumberAnimation { property: "opacity"; duration: 200 } - }, - Transition { - to: "starting" - NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 } - NumberAnimation { property: "opacity"; duration: 200 } - } - ] - -} diff --git a/examples/declarative/snake/snake.desktop b/examples/declarative/snake/snake.desktop deleted file mode 100644 index fef60907..00000000 --- a/examples/declarative/snake/snake.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=snake -Exec=/opt/snake/bin/snake -Icon=snake64 -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/snake/snake.pro b/examples/declarative/snake/snake.pro deleted file mode 100644 index ce1e28e3..00000000 --- a/examples/declarative/snake/snake.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/snake -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/snake -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/snake/snake.qmlproject b/examples/declarative/snake/snake.qmlproject deleted file mode 100644 index 431d2a9e..00000000 --- a/examples/declarative/snake/snake.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/snake" - } - JavaScriptFiles { - directory: "qml/snake" - } - ImageFiles { - directory: "qml/snake" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/snake/snake.svg b/examples/declarative/snake/snake.svg deleted file mode 100644 index 566acfad..00000000 --- a/examples/declarative/snake/snake.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/snake/snake64.png b/examples/declarative/snake/snake64.png deleted file mode 100644 index 707d5c4e..00000000 Binary files a/examples/declarative/snake/snake64.png and /dev/null differ diff --git a/examples/declarative/snake/snake80.png b/examples/declarative/snake/snake80.png deleted file mode 100644 index 6ad8096c..00000000 Binary files a/examples/declarative/snake/snake80.png and /dev/null differ diff --git a/examples/declarative/snake/snake_harmattan.desktop b/examples/declarative/snake/snake_harmattan.desktop deleted file mode 100644 index 10b0f792..00000000 --- a/examples/declarative/snake/snake_harmattan.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=snake -Exec=/usr/bin/single-instance /opt/snake/bin/snake -Icon=/usr/share/icons/hicolor/80x80/apps/snake80.png -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/twitter/main.cpp b/examples/declarative/twitter/main.cpp deleted file mode 100644 index 0a7a07f9..00000000 --- a/examples/declarative/twitter/main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qmlapplicationviewer.h" -#include - -Q_DECL_EXPORT int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QmlApplicationViewer viewer; - viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); - viewer.setMainQmlFile(QLatin1String("qml/twitter/twitter.qml")); - viewer.showExpanded(); - - return app.exec(); -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/Button.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/Button.qml deleted file mode 100644 index 794ba267..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/Button.qml +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: container - - signal clicked - - property string text - property bool keyUsing: false - - BorderImage { - id: buttonImage - source: "images/toolbutton.sci" - width: container.width; height: container.height - } - BorderImage { - id: pressed - opacity: 0 - source: "images/toolbutton.sci" - width: container.width; height: container.height - } - MouseArea { - id: mouseRegion - anchors.fill: buttonImage - onClicked: { container.clicked(); } - } - Text { - id: btnText - color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";} - anchors.centerIn: buttonImage; font.bold: true - text: container.text; style: Text.Raised; styleColor: "black" - font.pixelSize: 12 - } - states: [ - State { - name: "Pressed" - when: mouseRegion.pressed == true - PropertyChanges { target: pressed; opacity: 1 } - }, - State { - name: "Focused" - when: container.activeFocus == true - PropertyChanges { target: btnText; color: "#FFFFFF" } - } - ] - transitions: Transition { - ColorAnimation { target: btnText; } - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml deleted file mode 100644 index 08a01c09..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/FatDelegate.qml +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Component { - id: listDelegate - Item { - id: wrapper; width: wrapper.ListView.view.width; height: if(txt.height > 60){txt.height+10}else{60} //50+5+5 - function handleLink(link){ - if(link.slice(0,3) == 'app'){ - screen.setUser(link.slice(7)); - }else if(link.slice(0,4) == 'http'){ - Qt.openUrlExternally(link); - } - } - function addTags(str){ - var ret = str.replace(/@[a-zA-Z0-9_]+/g, '$&');//click to jump to user? - var ret2 = ret.replace(/http:\/\/[^ \n\t]+/g, '$&');//surrounds http links with html link tags - return ret2; - } - - // Strip away paranthesis - function userName(str) { - var user = str.replace(/\([\S|\s]*\)/gi, ""); - return user.trim(); - } - - Item { - id: moveMe; height: parent.height - Rectangle { - id: blackRect - color: "black"; opacity: wrapper.ListView.index % 2 ? 0.2 : 0.3; height: wrapper.height-2; width: wrapper.width; y: 1 - } - Item { - id: image; x: 6; width: 48; height: 48; smooth: true - anchors.verticalCenter: parent.verticalCenter - - Loading { x: 1; y: 1; width: 48; height: 48; visible: realImage.status != Image.Ready } - Image { - id: realImage; - source: userImage; x: 1; y: 1; - width:48; height:48; opacity:0 ; - onStatusChanged: { - if(status==Image.Ready) - image.state="loaded" - } - } - states: State { - name: "loaded"; - PropertyChanges { target: realImage ; opacity:1 } - } - transitions: Transition { NumberAnimation { target: realImage; property: "opacity"; duration: 200 } } - - } - Text { id:txt; y:4; x: 56 - text: '' - + ''+userName(name) + " from " +source - + "
" + statusText + ""; - textFormat: Qt.RichText - color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap - anchors.left: image.right; anchors.right: blackRect.right; anchors.leftMargin: 6; anchors.rightMargin: 6 - onLinkActivated: wrapper.handleLink(link) - } - } - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/Input.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/Input.qml deleted file mode 100644 index aa090407..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/Input.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -FocusScope { - id:container - width: 220 - height: 28 - BorderImage { source: "images/lineedit.sci"; anchors.fill: parent } - signal accepted - property alias text: input.text - property alias item:input - TextInput{ - id: input - width: parent.width - 12 - anchors.centerIn: parent - maximumLength:21 - font.pixelSize: 16; - font.bold: true - color: "#151515"; selectionColor: "mediumseagreen" - focus: true - onAccepted:{container.accepted()} - text: "" - selectByMouse: true - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/Loading.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/Loading.qml deleted file mode 100644 index 8520e150..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/Loading.qml +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Image { - id: loading; source: "images/loading.png" - NumberAnimation on rotation { - from: 0; to: 360; running: loading.visible == true; loops: Animation.Infinite; duration: 900 - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml deleted file mode 100644 index 2f91399d..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/MultiTitleBar.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - TitleBar { id: titleBar; width: parent.width; height: 60; - y: -80 - untaggedString: "Latest tweets from everyone" - taggedString: "Latest tweets from " - } - states: [ - State { - name: "search"; when: screen.state!="search" - PropertyChanges { target: titleBar; y: 0 } - } - ] - transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } - ] -} - diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml deleted file mode 100644 index 1d2fe52b..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/RssModel.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { id: wrapper - property variant model: xmlModel - property string from : "" - property string to : "" - property string phrase : "" - - property string mode : "everyone" - property int status: xmlModel.status - function reload() { xmlModel.reload(); } - XmlListModel { - id: xmlModel - - source: (from=="" && to=="" && phrase=="") ? "" : - 'http://search.twitter.com/search.atom?from='+from+"&to="+to+"&phrase="+phrase - - namespaceDeclarations: "declare default element namespace 'http://www.w3.org/2005/Atom'; " + - "declare namespace twitter=\"http://api.twitter.com/\";"; - - query: "/feed/entry" - - XmlRole { name: "statusText"; query: "content/string()" } - XmlRole { name: "timestamp"; query: "published/string()" } - XmlRole { name: "source"; query: "twitter:source/string()" } - XmlRole { name: "name"; query: "author/name/string()" } - XmlRole { name: "userImage"; query: "link[@rel = 'image']/@href/string()" } - - } - Binding { - property: "mode" - target: wrapper - value: {if(wrapper.tags==''){"everyone";}else if(wrapper.tags=='my timeline'){"self";}else{"user";}} - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml deleted file mode 100644 index 3991f06b..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/SearchView.qml +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -FocusScope { - id: wrapper - Column { - anchors.centerIn: parent - spacing: 20 - Column{ - spacing: 4 - Text { - text: "Posted by:" - font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" - horizontalAlignment: Qt.AlignRight - } - Input{ - id: fromIn - KeyNavigation.backtab: searchbutton - KeyNavigation.tab:toIn - onAccepted:searchbutton.doSearch(); - focus: true - } - Text { - text: "In reply to:" - font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" - horizontalAlignment: Qt.AlignRight - } - Input{ - id: toIn - KeyNavigation.backtab: fromIn - KeyNavigation.tab:phraseIn - onAccepted:searchbutton.doSearch(); - } - Text { - text: "Search phrase:" - font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black" - horizontalAlignment: Qt.AlignRight - } - Input{ - id: phraseIn - KeyNavigation.backtab: toIn - KeyNavigation.tab:searchbutton - onAccepted:searchbutton.doSearch(); - text: "Qt Quick" - } - } - Button { - width: 100 - height: 32 - id: searchbutton - keyUsing: true; - opacity: 1 - text: "Search" - KeyNavigation.tab: fromIn - Keys.onReturnPressed: searchbutton.doSearch(); - Keys.onEnterPressed: searchbutton.doSearch(); - Keys.onSelectPressed: searchbutton.doSearch(); - Keys.onSpacePressed: searchbutton.doSearch(); - onClicked: searchbutton.doSearch(); - - function doSearch() { - // Search ! allowed - if (wrapper.state=="invalidinput") - return; - - rssModel.from=fromIn.text; - rssModel.to= toIn.text; - rssModel.phrase = phraseIn.text; - screen.focus = true; - screen.state = "" - } - } - } - states: - State { - name: "invalidinput" - when: fromIn.text=="" && toIn.text=="" && phraseIn.text=="" - PropertyChanges { target: searchbutton ; opacity: 0.6 ; } - } - transitions: - Transition { - NumberAnimation { target: searchbutton; property: "opacity"; duration: 200 } - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml deleted file mode 100644 index 343e8797..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/TitleBar.qml +++ /dev/null @@ -1,130 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: titleBar - property string untaggedString: "Uploads from everyone" - property string taggedString: "Recent uploads tagged " - - BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } - - Item { - id: container - width: (parent.width * 2) - 55 ; height: parent.height - - function accept() { - titleBar.state = "" - background.state = "" - rssModel.tags = editor.text - } - - Item { - id:imageBox - x: 6; width: 0; height: 50; smooth: true - anchors.verticalCenter: parent.verticalCenter - - UserModel { user: rssModel.from; id: userModel } - Component { - id: imgDelegate; - Item { - id:imageitem - visible:true - Loading { width:48; height:48; visible: realImage.status != Image.Ready } - Image { id: realImage; source: image; width:48; height:48; opacity:0; } - states: - State { - name: "loaded" - when: (realImage.status == Image.Ready) - PropertyChanges { target: realImage; opacity:1 } - } - transitions: Transition { - NumberAnimation { target: realImage; property: "opacity"; duration: 200 } - } - } - } - ListView { id:view; model: userModel.model; x:1; y:1; delegate: imgDelegate } - states: - State { - when: !userModel.user=="" - PropertyChanges { target: imageBox; width: 50; } - } - transitions: - Transition { - NumberAnimation { target: imageBox; property: "width"; duration: 200 } - } - } - - Image { - id: quitButton - x: 5 - anchors.verticalCenter: parent.verticalCenter - source: "images/quit.png" - MouseArea { - anchors.fill: parent - onClicked: Qt.quit() - } - } - - Text { - id: categoryText - anchors { - left: quitButton.right; right: parent.right; leftMargin: 10; rightMargin: 10 - verticalCenter: parent.verticalCenter - } - elide: Text.ElideLeft - text: (rssModel.from=="" ? untaggedString : taggedString + rssModel.from) - font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black" - font.pixelSize: 12 - } - } - - states: State { - name: "Tags" - PropertyChanges { target: container; x: -tagButton.x + 5 } - PropertyChanges { target: editor; focus: true } - } - - transitions: Transition { - NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml deleted file mode 100644 index 1b0df39a..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/ToolBar.qml +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Item { - id: toolbar - - property alias button1Label: button1.text - property alias button2Label: button2.text - signal button1Clicked - signal button2Clicked - focus:true - BorderImage { source: "images/titlebar.sci"; width: parent.width; height: parent.height + 14; y: -7 } - Button { - id: button1 - anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 32 - onClicked: toolbar.button1Clicked() - focus:true - } - Button { - id: button2 - anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 32 - onClicked: toolbar.button2Clicked() - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml b/examples/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml deleted file mode 100644 index 0f5b48d0..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/UserModel.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -//This "model" gets the user information about the searched user. Mainly for the icon. - -Item { id: wrapper - property variant model: xmlModel - property string user : "" - property int status: xmlModel.status - function reload() { xmlModel.reload(); } - XmlListModel { - id: xmlModel - - source: user!= "" ? "http://twitter.com/users/show.xml?screen_name="+user : "" - query: "/user" - - XmlRole { name: "name"; query: "name/string()" } - XmlRole { name: "screenName"; query: "screen_name/string()" } - XmlRole { name: "image"; query: "profile_image_url/string()" } - XmlRole { name: "location"; query: "location/string()" } - XmlRole { name: "description"; query: "description/string()" } - XmlRole { name: "followers"; query: "followers_count/string()" } - //TODO: Could also get the user's color scheme, timezone and a few other things - } -} diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png deleted file mode 100644 index 5d370cd9..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/gloss.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png deleted file mode 100644 index 2cc38dc3..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci b/examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci deleted file mode 100644 index 054bff78..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/images/lineedit.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 10 -border.top: 10 -border.bottom: 10 -border.right: 10 -source: lineedit.png diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/loading.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/loading.png deleted file mode 100644 index 47a1589c..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/loading.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/quit.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/quit.png deleted file mode 100644 index 5bda1b6e..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/quit.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png deleted file mode 100644 index 9f36727e..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/stripes.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png deleted file mode 100644 index 51c90082..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci b/examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci deleted file mode 100644 index 0418d94c..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/images/titlebar.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 10 -border.top: 12 -border.bottom: 12 -border.right: 10 -source: titlebar.png diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png b/examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png deleted file mode 100644 index 11310013..00000000 Binary files a/examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.png and /dev/null differ diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci b/examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci deleted file mode 100644 index 9e4f9653..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/images/toolbutton.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 15 -border.top: 4 -border.bottom: 4 -border.right: 15 -source: toolbutton.png diff --git a/examples/declarative/twitter/qml/twitter/TwitterCore/qmldir b/examples/declarative/twitter/qml/twitter/TwitterCore/qmldir deleted file mode 100644 index 84d85c28..00000000 --- a/examples/declarative/twitter/qml/twitter/TwitterCore/qmldir +++ /dev/null @@ -1,10 +0,0 @@ -SearchView 1.0 SearchView.qml -Button 1.0 Button.qml -Input 1.0 Input.qml -FatDelegate 1.0 FatDelegate.qml -Loading 1.0 Loading.qml -MultiTitleBar 1.0 MultiTitleBar.qml -TitleBar 1.0 TitleBar.qml -RssModel 1.0 RssModel.qml -UserModel 1.0 UserModel.qml -ToolBar 1.0 ToolBar.qml diff --git a/examples/declarative/twitter/qml/twitter/twitter.qml b/examples/declarative/twitter/qml/twitter/twitter.qml deleted file mode 100644 index 8efc0765..00000000 --- a/examples/declarative/twitter/qml/twitter/twitter.qml +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "TwitterCore" 1.0 as Twitter - -Item { - id: screen; width: 320; height: 480 - property bool userView : false - property variant tmpStr - function setUser(str){hack.running = true; tmpStr = str} - function reallySetUser(){rssModel.from = tmpStr;rssModel.to = ""; rssModel.phrase = ""} - state:"searchquery" - //Workaround for bug 260266 - Timer{ interval: 1; running: false; repeat: false; onTriggered: screen.reallySetUser(); id:hack } - Keys.onEscapePressed: screen.state="searchquery" - Keys.onBacktabPressed: screen.state="searchquery" - Rectangle { - id: background - anchors.fill: parent; color: "#343434"; - - state:"searchquery" - Image { source: "TwitterCore/images/stripes.png"; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3 } - - MouseArea { - anchors.fill: parent - onClicked: screen.focus = false; - } - - Twitter.RssModel { id: rssModel } - Twitter.Loading { anchors.centerIn: parent; visible: rssModel.status==XmlListModel.Loading && state!='unauthed'} - Text { - width: 180 - text: "Could not access twitter using this screen name and password pair."; - color: "#cccccc"; style: Text.Raised; styleColor: "black"; wrapMode: Text.WordWrap - visible: rssModel.status==XmlListModel.Error; anchors.centerIn: parent - } - - Item { - id: views - x: 2; width: parent.width - 4 - y:60 //Below the title bars - height: parent.height - 100 - - Text { - id:title - text: "Search Twitter" - anchors.horizontalCenter: parent.horizontalCenter - font.pixelSize: 20; font.bold: true; color: "#bbb"; style: Text.Raised; styleColor: "black" - opacity:0 - } - - Twitter.SearchView{ - id: searchView - anchors.verticalCenter: parent.verticalCenter - width: parent.width; height: parent.height-60; - x: -(screen.width * 1.5) - } - - Twitter.FatDelegate { id: fatDelegate } - ListView { - id: mainView; model: rssModel.model; delegate: fatDelegate; - width: parent.width; height: parent.height; x: 0; cacheBuffer: 100; - } - } - - Twitter.MultiTitleBar { id: titleBar; width: parent.width } - Twitter.ToolBar { id: toolBar; height: 40; - //anchors.bottom: parent.bottom; - //TODO: Use anchor changes instead of hard coding - y: screen.height - 40 - width: parent.width; opacity: 0.9 - button1Label: "New Search" - button2Label: "Update" - onButton1Clicked: - { - screen.state="searchquery" - } - onButton2Clicked: rssModel.reload(); - } - } - states: [ - State { - name: "searchquery"; - PropertyChanges { target: searchView; x: 0; focus:true} - PropertyChanges { target: mainView; x: -(parent.width * 1.5) } - PropertyChanges { target: titleBar; y: -80 } - PropertyChanges { target: toolBar; y: screen.height } - PropertyChanges { target: toolBar } - PropertyChanges { target: title; opacity:1} - } - ] - transitions: [ - Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutQuad } } - ] -} diff --git a/examples/declarative/twitter/twitter.desktop b/examples/declarative/twitter/twitter.desktop deleted file mode 100644 index 5d1b851b..00000000 --- a/examples/declarative/twitter/twitter.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=twitter -Exec=/opt/twitter/bin/twitter -Icon=twitter64 -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/declarative/twitter/twitter.pro b/examples/declarative/twitter/twitter.pro deleted file mode 100644 index 68ece226..00000000 --- a/examples/declarative/twitter/twitter.pro +++ /dev/null @@ -1,24 +0,0 @@ -# Add more folders to ship with the application, here -folder_01.source = qml/twitter -folder_01.target = qml -DEPLOYMENTFOLDERS = folder_01 - -# Additional import path used to resolve QML modules in Creator's code model -QML_IMPORT_PATH = - -# If your application uses the Qt Mobility libraries, uncomment the following -# lines and add the respective components to the MOBILITY variable. -# CONFIG += mobility -# MOBILITY += - -# Speed up launching on MeeGo/Harmattan when using applauncherd daemon -# CONFIG += qdeclarative-boostable - -# The .cpp file which was generated for your project. Feel free to hack it. -SOURCES += main.cpp - -# Please do not modify the following two lines. Required for deployment. -desktopInstallPrefix=$$[QT_INSTALL_EXAMPLES]/declarative/twitter -exists(qmlapplicationviewer/qmlapplicationviewer.pri):include(qmlapplicationviewer/qmlapplicationviewer.pri) -else:include(../helper/qmlapplicationviewer/qmlapplicationviewer.pri) -qtcAddDeployment() diff --git a/examples/declarative/twitter/twitter.qmlproject b/examples/declarative/twitter/twitter.qmlproject deleted file mode 100644 index 3b360cf2..00000000 --- a/examples/declarative/twitter/twitter.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "qml/twitter" - } - JavaScriptFiles { - directory: "qml/twitter" - } - ImageFiles { - directory: "qml/twitter" - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/twitter/twitter.svg b/examples/declarative/twitter/twitter.svg deleted file mode 100644 index 566acfad..00000000 --- a/examples/declarative/twitter/twitter.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/examples/declarative/twitter/twitter64.png b/examples/declarative/twitter/twitter64.png deleted file mode 100644 index 707d5c4e..00000000 Binary files a/examples/declarative/twitter/twitter64.png and /dev/null differ diff --git a/examples/declarative/twitter/twitter80.png b/examples/declarative/twitter/twitter80.png deleted file mode 100644 index 6ad8096c..00000000 Binary files a/examples/declarative/twitter/twitter80.png and /dev/null differ diff --git a/examples/declarative/twitter/twitter_harmattan.desktop b/examples/declarative/twitter/twitter_harmattan.desktop deleted file mode 100644 index 40a4a1bc..00000000 --- a/examples/declarative/twitter/twitter_harmattan.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Version=1.0 -Type=Application -Terminal=false -Name=twitter -Exec=/usr/bin/single-instance /opt/twitter/bin/twitter -Icon=/usr/share/icons/hicolor/80x80/apps/twitter80.png -X-Window-Icon= -X-HildonDesk-ShowInToolbar=true -X-Osso-Type=application/x-executable diff --git a/examples/demos/doc/images/qml-calculator-example.png b/examples/demos/doc/images/qml-calculator-example.png deleted file mode 100644 index 0f9ced80..00000000 Binary files a/examples/demos/doc/images/qml-calculator-example.png and /dev/null differ diff --git a/examples/demos/doc/images/qml-minehunt-demo.png b/examples/demos/doc/images/qml-minehunt-demo.png deleted file mode 100644 index 3b695693..00000000 Binary files a/examples/demos/doc/images/qml-minehunt-demo.png and /dev/null differ diff --git a/examples/demos/doc/images/qml-photoviewer-demo.png b/examples/demos/doc/images/qml-photoviewer-demo.png deleted file mode 100644 index be6f1bf1..00000000 Binary files a/examples/demos/doc/images/qml-photoviewer-demo.png and /dev/null differ diff --git a/examples/demos/doc/images/qml-rssnews-demo.png b/examples/demos/doc/images/qml-rssnews-demo.png deleted file mode 100644 index b4143b46..00000000 Binary files a/examples/demos/doc/images/qml-rssnews-demo.png and /dev/null differ diff --git a/examples/demos/doc/images/qml-samegame-demo.png b/examples/demos/doc/images/qml-samegame-demo.png deleted file mode 100644 index 945f2b96..00000000 Binary files a/examples/demos/doc/images/qml-samegame-demo.png and /dev/null differ diff --git a/examples/demos/doc/images/qml-snake-demo.png b/examples/demos/doc/images/qml-snake-demo.png deleted file mode 100644 index d3c077d1..00000000 Binary files a/examples/demos/doc/images/qml-snake-demo.png and /dev/null differ diff --git a/examples/demos/doc/images/qml-twitter-demo.png b/examples/demos/doc/images/qml-twitter-demo.png deleted file mode 100644 index 63d6486a..00000000 Binary files a/examples/demos/doc/images/qml-twitter-demo.png and /dev/null differ diff --git a/examples/demos/doc/src/qml-calculator.qdoc b/examples/demos/doc/src/qml-calculator.qdoc deleted file mode 100644 index 5a12038f..00000000 --- a/examples/demos/doc/src/qml-calculator.qdoc +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Calculator - \example declarative/calculator - \brief Shows how to write a calculator in QML - \ingroup qmldemos - - This example shows how to write a simple calculator application in QML and JavaScript. - - \image qml-calculator-example.png -*/ diff --git a/examples/demos/doc/src/qml-minehunt.qdoc b/examples/demos/doc/src/qml-minehunt.qdoc deleted file mode 100644 index ba9c6616..00000000 --- a/examples/demos/doc/src/qml-minehunt.qdoc +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Minehunt - \example declarative/minehunt - \brief Shows how to write a Minehunt game in QML - \ingroup qmldemos - - This example shows how to create a simple Minehunt game, using QML for the - UI and C++ for the game logic. - - \image qml-minehunt-demo.png -*/ diff --git a/examples/demos/doc/src/qml-photoviewer.qdoc b/examples/demos/doc/src/qml-photoviewer.qdoc deleted file mode 100644 index 57062bcf..00000000 --- a/examples/demos/doc/src/qml-photoviewer.qdoc +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Photo Viewer - \example declarative/photoviewer - \brief Shows how to write a Flickr photo viewer in QML - \ingroup qmldemos - - This example shows how to write a Flickr photo viewer application in QML. - - \image qml-photoviewer-demo.png -*/ diff --git a/examples/demos/doc/src/qml-rssnews.qdoc b/examples/demos/doc/src/qml-rssnews.qdoc deleted file mode 100644 index 25577769..00000000 --- a/examples/demos/doc/src/qml-rssnews.qdoc +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title RSS News - \example declarative/rssnews - \brief Shows how to write an RSS news reader in QML - \ingroup qmldemos - - This example shows how to write an RSS news reader in QML. - - \image qml-rssnews-demo.png -*/ diff --git a/examples/demos/doc/src/qml-samegame.qdoc b/examples/demos/doc/src/qml-samegame.qdoc deleted file mode 100644 index 5b256e56..00000000 --- a/examples/demos/doc/src/qml-samegame.qdoc +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Same Game - \example declarative/samegame - \brief Shows how to write a Same Game in QML - \ingroup qmldemos - - This example shows how to write a 'Same Game' game in QML, using Javascript - for all the game logic. - - \image qml-samegame-demo.png -*/ diff --git a/examples/demos/doc/src/qml-snake.qdoc b/examples/demos/doc/src/qml-snake.qdoc deleted file mode 100644 index d1d38bd5..00000000 --- a/examples/demos/doc/src/qml-snake.qdoc +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Snake - \example declarative/snake - \brief Shows how to write a Snake game in QML - \ingroup qmldemos - - This example shows how to write a Snake game in QML, controlled by the - keyboard as well as the mouse. - - \image qml-snake-demo.png -*/ diff --git a/examples/demos/doc/src/qml-twitter.qdoc b/examples/demos/doc/src/qml-twitter.qdoc deleted file mode 100644 index d81f41ac..00000000 --- a/examples/demos/doc/src/qml-twitter.qdoc +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Twitter Mobile - \example declarative/twitter - \brief Shows how to write a Twitter client in QML - \ingroup qmldemos - - This example shows how to write a mobile Twitter search client in QML. Use it to - see what people think about Qt Quick! - - \image qml-twitter-demo.png -*/ -- cgit v1.2.3